#include <stdio.h> #include <stdlib.h> int main() { int a=1,b=0,c=0,d=0; while(a<=100&&c<=100) { b+=a; a+=2; d+=c; c+=2; } printf("100以内奇数和为%d\n",b); printf("100以内偶数和为%d\n",d); return 0; }