분류 전체보기
-
[java]백준 최댓값 2562번알고리즘 문제풀이/백준(자바) 2023. 4. 10. 23:07
코드 import java.util.Scanner; public class BOJ_2562 { public static void main(String[] args) { Scanner in = new Scanner(System.in); int[] num = {in.nextInt(),in.nextInt(),in.nextInt(), in.nextInt(),in.nextInt(),in.nextInt(), in.nextInt(),in.nextInt(),in.nextInt()}; in.close(); int m=0;//max값 int s=0;//칸수 for(int i=0; im){ m=num[i]; s=i+1; } } System.out.println(m+"\n"+s); } } 링크 https://www.acmic..
-
[java]백준 A+B - 4 10951번알고리즘 문제풀이/백준(자바) 2023. 4. 7. 20:51
코드 import java.util.Scanner; public class BOJ_10951 { public static void main(String[] args) { Scanner in = new Scanner(System.in); while (in.hasNext()) { //입력값이 있으면 True //없다 False int a= in.nextInt(); int b= in.nextInt(); System.out.println(a+b); } in.close(); } } 링크 https://www.acmicpc.net/problem/10951 10951번: A+B - 4 두 정수 A와 B를 입력받은 다음, A+B를 출력하는 프로그램을 작성하시오. www.acmicpc.net