标签:blog text putchar name algorithm algo har utc using
原作者看了不会生气的。对吧。
#include<cstdio> #include<cstdlib> #include<cstring> #include<cmath> #include<iostream> #include<algorithm> using namespace std; inline int read() { char ch=getchar(); int re=0; bool fl=1; /* if (ch==‘-‘) { re=0; ch=getchar(); } */ while (ch>=‘0‘&&ch<=‘9‘) { re=re*10+ch-‘0‘; ch=getchar(); } return fl?re:-re; } inline void write(int re) { /* if (re<0) { putchar(‘-‘); re=-re; } */ if (re>9) write(re/10); putchar(re%10+‘0‘); } int main() { int n=read(),i,a; for (i=1;i<=n;i++) { a=read(); write(a); putchar(‘\n‘); } return 0; }
注释的是考虑负数的情况(我觉得最好写上)
标签:blog text putchar name algorithm algo har utc using
原文地址:http://www.cnblogs.com/hanser/p/7450088.html