728x90
반응형
87 : 여기까지! 이제 그만~
//자바코드
import java.util.Scanner;
public class Main{
public static void main (String[] args){
Scanner sc = new Scanner(System.in);
int num = sc.nextInt();
sc.close();
int sum = 0;
int i = 0;
while(sum<num){
i++;
sum += i;
}
System.out.println(sum);
}
}
88 : 3의 배수는 통과?
//자바코드
import java.util.Scanner;
public class Main{
public static void main (String[] args){
Scanner sc = new Scanner(System.in);
int num = sc.nextInt();
sc.close();
for(int i = 0; i<=num; i++){
if(i%3==0)
System.out.print("");
} else{
System.out.print(i + " ");
}
}
}
}
89 : 수 나열하기1
//자바코드
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();
int c = sc.nextInt();
int count = 1;
sc.close();
while(count != c){
a += b;
count++;
}
System.out.println(a);
}
}
90 : 수 나열하기2
//자바코드
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();
int c = sc.nextInt();
sc.close();
for(int i=1;i<c;i++){
a *= b;
}
System.out.println(a);
}
}
91 : 수 나열하기3
//자바코드
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();
int c = sc.nextInt();
int d = sc.nextInt();
sc.close();
for(int i=1;i<d;i++){
a = a*b+c;
}
System.out.println(a);
}
}
92 : 함께 문제 푸는 날
//자바코드
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();
int c = sc.nextInt();
sc.close();
int count = 1;
while(count%a !=0 || count%b !=0 || count%c !=0){
count++;
}
System.out.println(count);
}
}
728x90
반응형
'Coding Test > CodeUp' 카테고리의 다른 글
CodeUp_Java 기초 100제 - [기초-2차원배열] 96~99 (0) | 2022.02.14 |
---|---|
CodeUp_Java 기초 100제 - [기초-1차원배열] 93~95 (0) | 2022.02.14 |
CodeUp_Java 기초 100제 - [기초-종합] 78~86 (0) | 2022.02.14 |
CodeUp_Java 기초 100제 - [기초-반복실행구조] 74~77 (0) | 2022.02.14 |
CodeUp_Java 기초 100제 - [기초-반복실행구조] 0 입력될 때까지 무한 출력하기(1)~(3) 71~73 (0) | 2022.02.14 |
댓글