Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |
Tags
- 협업
- 리덕스장바구니
- 알고리즘
- react
- 정렬
- OS
- Operating System
- 타입스크립트
- react-redux
- js to ts
- 스프링
- 백준
- 프로그래머스
- 분할메모리할당
- 토이프로젝트
- 자료구조
- web
- Spring
- memory
- error
- 파이썬
- 기초100제
- 코드업
- CPU 스케줄링
- codeup
- C++
- 일상
- Redux
- 공부
- Java
Archives
- Today
- Total
감자튀김 공장🍟
[CodeUp]JAVA 1042~1051 본문
반응형
[1042]
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
String a = scanner.nextLine();
String b[] = a.split(" ");
int c = Integer.parseInt(b[0]);
int d = Integer.parseInt(b[1]);
System.out.println(c / d);
}
}
[1043]
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
String a = scanner.nextLine();
String b[] = a.split(" ");
int c = Integer.parseInt(b[0]);
int d = Integer.parseInt(b[1]);
System.out.println(c % d);
}
}
[1044]
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
long a = scanner.nextInt();
System.out.println(a + 1);
}
}
[1045]
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
String a = scanner.nextLine();
String b[] = a.split(" ");
int c = Integer.parseInt(b[0]);
int d = Integer.parseInt(b[1]);
float c1 = c;
float d1 = d;
System.out.println(c + d);
System.out.println(c - d);
System.out.println(c * d);
System.out.println(c / d);
System.out.println(c % d);
System.out.println(String.format("%.2f", c1 / d1));
}
}
[1046]
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
String a = scanner.nextLine();
String b[] = a.split(" ");
int c = Integer.parseInt(b[0]);
int d = Integer.parseInt(b[1]);
int e = Integer.parseInt(b[2]);
int sum = c + d + e;
float sum2 = sum / 3;
System.out.println(sum);
System.out.println(String.format("%.1f", sum2));
}
}
[1047]
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int a = scanner.nextInt();
System.out.printf("%d", a << 1);
}
}
[1048]
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
String a = scanner.next();
String b = scanner.next();
int a1 = Integer.parseInt(a);
int b1 = Integer.parseInt(b);
System.out.printf("%d", a1 << b1);
}
}
[1049]
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int a = scanner.nextInt();
int b = scanner.nextInt();
if(a > b) {
System.out.println(1);
}
else {
System.out.println(0);
}
}
}
[1050]
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int a = scanner.nextInt();
int b = scanner.nextInt();
if(a == b) {
System.out.println(1);
}
else {
System.out.println(0);
}
}
}
[1051]
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int a = scanner.nextInt();
int b = scanner.nextInt();
if(a <= b) {
System.out.println(1);
}
else {
System.out.println(0);
}
}
}
반응형
'Algorithm > CodeUp' 카테고리의 다른 글
[CodeUp]JAVA 1062~1071 (0) | 2021.03.16 |
---|---|
[Codeup]JAVA 1052~1061 (0) | 2021.03.15 |
[CodeUp]JAVA 1032~1041 (0) | 2021.03.13 |
[CodeUp]JAVA 1022~1031 (0) | 2021.03.13 |
[CodeUP]JAVA 1012~1021 (0) | 2021.03.12 |
Comments