You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

12 lines
308 B

2 years ago
#include <bits/stdc++.h>
using namespace std;
int main() {
//通用mod运算重复输出指定的1-N的方法注意(i-1)%20-1的妙处
for (int i = 1; i < 101; ++i) {
cout << setw(4) << (i - 1) % 20 + 1 << " ";
if (i % 20 == 0)cout << endl;
}
return 0;
}