close
import java.io.*;
public class question07 {
public static void main(String args[])throws IOException {
BufferedReader buf=new BufferedReader(new InputStreamReader(System.in));
int num[]=new int[20];
int j=0;
int k=0;
for (int i=0;i System.out.print("請輸入數字"+(i+1)+":");
num[i]=Integer.parseInt(buf.readLine());
if (num[i]%2==1) j++;
if (num[i]%2==0) k++;
}
System.out.println("奇數有"+j+"個,偶數有"+k+"個");
}
}
全站熱搜
留言列表