13 lines
193 B
C++
13 lines
193 B
C++
|
#include <iostream>
|
||
|
|
||
|
using namespace std;
|
||
|
|
||
|
int main()
|
||
|
{
|
||
|
int i = 1, total = 0;
|
||
|
for (; i <= 100; i++)
|
||
|
total += i;
|
||
|
|
||
|
cout << "1~100的和为: " << total << endl;
|
||
|
return 0;
|
||
|
}
|