๐ฅBaekjoon start๐ฅ

arielยท2021๋ 10์ 27์ผ
1

2021-10-27

โ์ช ์ ํจ๊ป ํ๋ฃจ์ 30๋ถ ์ด์ ์์โจ

๐ป ์์ถ๋ ฅ๊ณผ ์ฌ์น์ฐ์ฐ

1000, 1001, 10998

public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int a, b;
a = sc.nextInt();
b = sc.nextInt();
System.out.println(a + b);
System.out.println(a - b);
System.out.println(a * b);
}
}

1008

import java.util.Scanner;

public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
double a, b;
a = sc.nextInt();
b = sc.nextInt();
System.out.println(a / b);
}
}

10869

import java.util.Scanner;

public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int a, b;
a = sc.nextInt();
b = sc.nextInt();
System.out.println(a + b);
System.out.println(a - b);
System.out.println(a * b);
System.out.println(a / b);
System.out.println(a % b);
}
}

10430

import java.util.Scanner;

public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int a, b, c;
a = sc.nextInt();
b = sc.nextInt();
c = sc.nextInt();
System.out.println((a+b)%c);
System.out.println(((a%c)+(b%c))%c);
System.out.println((a*b)%c);
System.out.println(((a%c)*(b%c))%c);

}
}

2588๋ฒ

import java.util.Scanner;

public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);

int a = sc.nextInt();
int b = sc.nextInt();

System.out.println(a*(b%10));
System.out.println(a*(b%100/10));
System.out.println(a*(b/100));
System.out.println(a*b);

}
}

(โ'โก'โ) ์ค๋ ๊ธฐ์ตํด์ผ ํ  ๊ฒ โฐ(ยฐโฝยฐ)โฏ

scannerํด๋์ค

โ
Scannerํด๋์ค๋ ์ฝ์๋ก๋ถํฐ ๊ธฐ๋ณธ ํ์์ ๊ฐ์ ๋ฐ๋ก ์ฝ์ ์ ์๋ค.

Scanner scanner = new Scanner(System.in);