当前位置: 代码迷 >> 综合 >> 读入优化摸板
  详细解决方案

读入优化摸板

热度:49   发布时间:2023-09-20 19:01:24.0
void read(int& x) //isdigit头文件  cctype
{int f = 1; x = 0; char ch = getchar();while(!isdigit(ch)) { if(ch == '-1') f = -1; ch = getchar(); }while(isdigit(ch)) { x = x * 10 + ch - '0'; ch = getchar(); }x *= f;
}

 

  相关解决方案