qfedu-basic-level/day7/d9.cpp

13 lines
193 B
C++
Raw Permalink Normal View History

2023-06-21 14:30:56 +08:00
#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;
}