ALGORITHM/BAEKJOON

[백준] C++, JAVA, C# / 1001번

최옥구 2023. 1. 6. 08:38
반응형

[C++ 소스 코드]

#include <iostream>
using namespace std;

int main()
{
	int a{}, b{};
	cin >> a >> b;
	cout << a - b;
}

[JAVA 소스 코드]

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        int x = input.nextInt();
        int y = input.nextInt();

        System.out.println(x - y);
    }
}

[C# 소스 코드]

namespace Blog
{
    internal class Program
    {
        static void Main(string[] args)
        {
            string srt = Console.ReadLine();
            string[] s = srt.Split();
            int x = int.Parse(s[0]);
            int y = int.Parse(s[1]);
            Console.WriteLine(x - y);
        }
    }
}
반응형

'ALGORITHM > BAEKJOON' 카테고리의 다른 글

[백준] C++, JAVA, C# / 1000번  (0) 2023.01.05