实验代码: #include<iostream> using namespace std; int main() { int i=1,sum=0; while(i<=99) { sum+=i; i+=2; } cout<<"sum="<<sum<<endl; } 实验结果: sum=2500 -------------------------------- Process exited after 0.1489 seconds with return value 0 请按任意键继续. . .