输入外挂

来源:互联网 发布:java按键子弹不走 编辑:程序博客网 时间:2024/05/21 05:04

非负数。

inline void In(int& res){    int c;    while((c = getchar())<'0' || c>'9');    res = c-'0';    while((c = getchar())>='0' && c<='9')        res = res*10 + c-'0';}

有负数。

inline void In(int& res){    int f=1,c;    while(((c = getchar())<'0' || c>'9') && c!='-');    c=='-' ? f=res=0 : res=c-'0';    while((c = getchar())>='0' && c<='9')        res = res*10 + c-'0';    if(!f)   res=-res;}