AcWing 721. 递增序列
原题链接
简单
作者:
citrus_7
,
2021-01-28 21:48:50
,
所有人可见
,
阅读 309
#include <iostream>
using namespace std;
int main()
{
int x;
while (cin >> x && x)
{
for (int i = 1; i <= x; i ++ ) cout << i << ' ';
cout << endl;
}
return 0;
}
#include <iostream>
using namespace std;
int main()
{
int x;
while (1)
{
cin >> x;
if (!x) break;
for (int i = 1; i <= x; i ++ ) cout << i << ' ';
cout << endl;
}
return 0;
}
#include <iostream>
using namespace std;
int main()
{
int x;
while (cin >> x, x)
{
for (int i = 1; i <= x; i ++ ) cout << i << ' ';
cout << endl;
}
return 0;
}
#include <cstdio>
#include <iostream>
using namespace std;
int main()
{
int x;
while (scanf("%d", &x), x)
{
for (int i = 1; i <= x; i ++ ) cout << i << ' ';
cout << endl;
}
return 0;
}