练习题

import java.util.Scanner;


public class Main6
{
public static void main(String[] args)
{
int number;
int count=0;
int amount=0;
Scanner in=new Scanner(System.in);
number=in.nextInt();
while(number!=-1)
{

if(number%2==0)
{
count=count+1;
}
else if(number%2!=0)
{
amount=amount+1;
}
number=in.nextInt();
}
System.out.println(count+" "+amount);
}

}

posted @ 2018-03-15 21:25  w2w2  阅读(63)  评论(0)    收藏  举报