반응형
# 1043
import java.util.*;
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);
}
}
# 1044
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int N = sc.nextInt();
long result = (long)N + 1;
System.out.println(result);
}
}
# 1045
import java.util.*;
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);
System.out.println(a - b);
System.out.println(a * b);
System.out.println(a / b);
System.out.println(a % b);
double A = (double) a;
System.out.printf("%.2f", A/b);
}
}
# 1046
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int a = sc.nextInt();
int b = sc.nextInt();
int c = sc.nextInt();
System.out.println(a + b + c);
double A = (double) a;
System.out.printf("%.1f", ((A+b+c)/3));
}
}
# 1047
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int a = sc.nextInt();
System.out.printf("%d", a<<1);
}
}
# 1048
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int a = sc.nextInt();
int b = sc.nextInt();
int re = (int) Math.pow(2, b);
System.out.println(a * re);
}
}
# 1049
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int a = sc.nextInt();
int b = sc.nextInt();
if (a > b) {
System.out.println(1);
} else if (a <= b) {
System.out.println(0);
}
}
}
# 1050
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int a = sc.nextInt();
int b = sc.nextInt();
if (a == b) {
System.out.println(1);
} else {
System.out.println(0);
}
}
}
# 1051
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int a = sc.nextInt();
int b = sc.nextInt();
if (a <= b) {
System.out.println(1);
} else {
System.out.println(0);
}
}
}
# 1052
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int a = sc.nextInt();
int b = sc.nextInt();
if (a != b) {
System.out.println(1);
} else {
System.out.println(0);
}
}
}
반응형
'개인 공부 > JAVA' 카테고리의 다른 글
[JAVA] Code Up 기초 100제 (1063 ~ 1072) (0) | 2021.06.23 |
---|---|
[JAVA] Code Up 기초 100제 (1053 ~ 1062) (0) | 2021.06.22 |
[JAVA] Code Up 기초 100제 (1033 ~ 1042) (0) | 2021.06.20 |
[JAVA] Code Up 기초 100제 (1023 ~ 1032) (0) | 2021.06.19 |
[JAVA] Code Up 기초 100제 (1001 ~ 1011) (0) | 2021.06.18 |