반응형
백준 시작! 유뷰브에서 현재까지 나온 알고리즘은 다 풀었으니까 이제 백준 알고리즘을 단계별로 풀어가겠습니다.
1. 2557
public class Main {
public static void main(String[] args) {
System.out.println("Hello World!");
}
}
2. 10718
public class Main {
public static void main(String[] args) {
System.out.println("강한친구 대한육군");
System.out.println("강한친구 대한육군");
}
}
3. 10171
public class Main {
public static void main(String[] args) {
System.out.println("\\ /\\");
System.out.println(" ) ( ')");
System.out.println("( / )");
System.out.println(" \\(__)|");
}
}
4. 10172
public class Main {
public static void main(String[] args) {
System.out.println("|\\_/|");
System.out.println("|q p| /}");
System.out.println("( 0 )\"\"\"\\");
System.out.println("|\"^\"' |");
System.out.println("||_/=\\\\__|");
}
}
5. 7287
public class Main {
public static void main(String[] args) {
System.out.println("19");
System.out.println("tonyzorz");
}
}
6. 1000
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int first = scan.nextInt();
int second = scan.nextInt();
System.out.println(first + second);
}
}
7. 1001
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int first = scan.nextInt();
int second = scan.nextInt();
System.out.println(first - second);
}
}
8. 10998
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int first = scan.nextInt();
int second = scan.nextInt();
System.out.println(first * second);
}
}
9. 1008
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
double first = scan.nextInt();
double second = scan.nextInt();
System.out.println(first/second);
}
}
10. 10869
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int first = scan.nextInt();
int second = scan.nextInt();
System.out.println(first + second);
System.out.println(first - second);
System.out.println(first * second);
System.out.println(first / second);
System.out.println(first % second);
}
}
11. 10430
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int first = scan.nextInt();
int second = scan.nextInt();
int third = scan.nextInt();
System.out.println((first+second)%third);
System.out.println((first%third+second%third)%third);
System.out.println((first*second)%third);
System.out.println((first%third*second%third)%third);
}
}
12. 2588
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int first = scan.nextInt();
int second = scan.nextInt();
int a = first * (second - second/10 * 10);
int b = first * (second/10 % 10);
int c = first * (second/10/10);
int d = a + (b * 10) + (c * 100);
System.out.println(a);
System.out.println(b);
System.out.println(c);
System.out.println(d);
}
}
반응형
'IT > 알고리즘' 카테고리의 다른 글
백준 3단계(11/23/19)(2739, 10950, 8393, 15552, 2741, 2742, 11021, 11022, 2438, 2439, 10871) (0) | 2019.11.23 |
---|---|
백준 2단계(11/23/19)(1330, 9498, 2753, 2884, 10817) (0) | 2019.11.23 |
코딩테스트 (11/21/19) (0) | 2019.11.21 |
기초 알고리즘6(November 20 2019) (0) | 2019.11.20 |
기초 알고리즘5(Novemeber 4 2019) (0) | 2019.11.05 |