标签:read line key char getc ams cal pre bsp
inline void read(int &x){
int ans=0,f=1;
char c=getchar();
while(c>‘9‘||c<‘0‘){
if(c==‘-‘)f=-1;
c=getchar();
}
while(c>=‘0‘&&c<=‘9‘){
ans=ans*10+int(c)-48;
c=getchar();
}
x=ans*f;
}
inline void readln(int &x){
read(x);
putchar(‘\n‘);
}
inline void write(int x){
if(x<0)x=-x,putchar(‘-‘);
if(x>9)write(x/10);
putchar(x%10+48);
}
inline void writeln(int x){
write(x);
putchar(‘\n‘);
}
可把int改成long long等。
标签:read line key char getc ams cal pre bsp
原文地址:https://www.cnblogs.com/Y15BeTa/p/10315331.html