int i=1; while (i<=100) { if(i%2==1) printf(" %d",i); i++; } 或 while (i<=100) { printf(" %d",i); i+=2; } 结果