//计算0-100之间的奇数和偶数的和标签:奇数,int,System,偶数,Demo17,解决问题,循环,out From: https://www.cnblogs.com/CHX249/p/16754880.html
package com.HuanXin.JiBen_JieGou;
public class Demo09_For_1 {
public static void main(String[] args) {
int A =0;//奇数的和
int B =0;//偶数的和
for (int i =0; i<=100; i++) {
if (i%2!=0){
A+=i;//A=A+i
}else {
B+=i;//B=B+i
}
}
System.out.println("奇数的总和"+A);
System.out.println("偶数的总和"+B);
}
}