๋ฐ์ํ
1071๋ฒ
import java.io.*;
import java.util.*;
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String[] a = br.readLine().split(" ");
br.close();
PrintWriter pw = new PrintWriter(System.out);
for (int i = 0; i < a.length; i++) {
if (a[i].equals("0")) {
break;
} else {
pw.println(a[i]);
}
}
pw.flush();
pw.close();
}
}
1072๋ฒ (์คํ์ค ์๋ฌ๊ฐ ๋ธ;;)
import java.util.*;
import java.io.*;
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int n = Integer.parseInt(br.readLine());
int[] arr = new int[n];
for (int i = 0; i < n; i++) {
arr[i] = Integer.parseInt(br.readLine());
}
for (int i = 0; i < n; i++) {
System.out.println(arr[i]);
}
}
}
์ธํ ๋ฆฌ์ ์ด์์ ๋๋ฆฌ๋ฉด ์ ์์ ์ผ๋ก ๋์ค๋๋ฐ ๋ญ์ง? ์ ์ด๋ฌ๋์ง ์์๋๋ถ...?
1073๋ฒ
import java.io.*;
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String[] a = br.readLine().split(" ");
for (int i = 0; i < a.length; i++) {
if (a[i].equals("0")) {
break;
} else {
System.out.println(a[i]);
}
}
}
}
1074๋ฒ
import java.io.*;
import java.util.*;
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
StringTokenizer st = new StringTokenizer(br.readLine());
int a = Integer.parseInt(st.nextToken());
br.close();
while (true) {
if (a == 0) break;
System.out.println(a);
a--;
}
}
}
1075๋ฒ
import java.io.*;
import java.util.*;
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
StringTokenizer st = new StringTokenizer(br.readLine());
int a = Integer.parseInt(st.nextToken());
br.close();
while (true) {
if (a <= 0)
break;
System.out.println(a - 1);
a--;
}
}
}
1076๋ฒ
import java.io.*;
import java.util.*;
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
char a = br.readLine().charAt(0);
for (char i = 'a'; i <= a; i++) {
System.out.print(i + " ");
}
}
}
1077๋ฒ
import java.io.*;
import java.util.*;
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
StringTokenizer st = new StringTokenizer(br.readLine());
int a = Integer.parseInt((st.nextToken()));
br.close();
for (int i = 0; i <= a; i++) {
System.out.println(i);
}
}
}
1078๋ฒ
import java.io.*;
import java.util.*;
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
StringTokenizer st = new StringTokenizer(br.readLine());
int a = Integer.parseInt((st.nextToken()));
int result = 0;
br.close();
for (int i = 0; i <= a; i++) {
if (i % 2 == 0) {
result += i;
}
}
System.out.println(result);
}
}
1079๋ฒ
import java.io.*;
import java.util.*;
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String[] a = br.readLine().split(" ");
br.close();
for (int i = 0; i < a.length; i++) {
System.out.println(a[i]);
if (a[i].equals("q")) {
break;
}
}
}
}
1080๋ฒ
import java.io.*;
import java.util.*;
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
StringTokenizer st = new StringTokenizer(br.readLine());
int a = Integer.parseInt(st.nextToken());
int sum = 0;
br.close();
for (int i = 1; i <= a; i++) {
sum = sum += i;
if (sum >= a) {
System.out.println(i);
break;
}
}
}
}
๋ฐ์ํ
'Algorithm > CodeUp ๊ธฐ์ด 100์ ' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[์ฝ๋์ ๊ธฐ์ด 100์ -JAVA] 1061~1070๋ฒ (0) | 2023.03.04 |
---|---|
[์ฝ๋์ ๊ธฐ์ด 100์ -JAVA] 1051~1060๋ฒ (0) | 2023.03.04 |
[์ฝ๋์ ๊ธฐ์ด 100์ -JAVA] 1041~1050๋ฒ (0) | 2023.03.04 |
[์ฝ๋์ ๊ธฐ์ด 100์ -C์ธ์ด] 1031~1040๋ฒ (0) | 2023.02.27 |
[์ฝ๋์ ๊ธฐ์ด 100์ -C์ธ์ด] 1021~1030๋ฒ (0) | 2023.02.27 |
๋๊ธ