int i = 1;int sum = 0;do { if (i % 2 == 1) { sum += i;System.out.println(i);} i++;} while (i <= 100);System.out.println(sum);
public static void main(String[] args){ int i = 1; int sum = 0; while(i<100){ sum+=i; i+=2; } System.out.println("1-100的奇数和为sum = "+sum); System.out.println("--- "); int j = 1; sum = 0; while(j <= 100){ if(j%2 == 0){ sum+=j; } j++; } System...