mirror of
https://git.sb/baoshuo/OI-codes.git
synced 2024-12-24 18:52:02 +00:00
P3. 输出测试
https://hydro.ac/d/system_test/record/61581bd297ec9cde15d81a24
This commit is contained in:
parent
d3ee47a37e
commit
8febbb0bac
39
Hydro/d/system_test/3/3.cpp
Normal file
39
Hydro/d/system_test/3/3.cpp
Normal file
@ -0,0 +1,39 @@
|
||||
#include <bits/stdc++.h>
|
||||
|
||||
using namespace std;
|
||||
|
||||
int n;
|
||||
|
||||
inline int read() {
|
||||
int x = 0, w = 1;
|
||||
char c;
|
||||
while (!isdigit(c)) {
|
||||
if (c == '-') w = -1;
|
||||
c = getchar();
|
||||
}
|
||||
while (isdigit(c)) {
|
||||
x = x * 10 + (c - '0');
|
||||
c = getchar();
|
||||
}
|
||||
return x * w;
|
||||
}
|
||||
|
||||
void write(int x) {
|
||||
if (x < 0) {
|
||||
putchar('-');
|
||||
x = -x;
|
||||
}
|
||||
if (x > 9) write(x / 10);
|
||||
putchar(x % 10 ^ 48);
|
||||
return;
|
||||
}
|
||||
|
||||
int main() {
|
||||
n = read();
|
||||
for (int i = 1; i <= n; i++) {
|
||||
write(i);
|
||||
putchar(' ');
|
||||
}
|
||||
putchar('\n');
|
||||
return 0;
|
||||
}
|
Loading…
Reference in New Issue
Block a user