现在的位置: 首页 > 综合 > 正文

输入外挂

2018年04月04日 ⁄ 综合 ⁄ 共 292字 ⁄ 字号 评论关闭

非负数。

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;
}

抱歉!评论已关闭.