求1-50的偶数和,和奇数和
public static void main(String args[]){
int doubleNumber = 0;
int singleNumber = 0;
int i =1;
while(i <= 50){
if(i %2==0){
doubleNumber+=i;
}else{
singNumber+=i;
}
i++;
}
System.out.println(doubeNumber);
System.out.println(singleNumber);
}
你来是缘分,你走也是