- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathArray_Test7.java
More file actions
Latest commit
25 lines (23 loc) · 586 Bytes
/
Copy pathArray_Test7.java
File metadata and controls
25 lines (23 loc) · 586 Bytes
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
importjava.util.*;
classArray_Test7{
publicstaticvoidmain(Stringar[]){
Scannersc=newScanner(System.in);
intn[]=newint[10];
for (inti=0; i<n.length; i++) {
System.out.print(i+1+"번째 수를 입력하세요.(1~100) => ");
n[i]=sc.nextInt();
if (n[i]%2==0 && 1<=n[i] && n[i]<=100) {
System.out.println("짝수");
System.out.println();
}
elseif (n[i]%2==1 && 1<=n[i] && n[i]<=100) {
System.out.println("홀수");
System.out.println();
}
else {
System.out.println("1에서 100사이의 수를 입력하세요.");
System.out.println();
}
}
}
}