就是一个板子。。。
template <
class T>
void read(T &
x){
char c;
bool op =
0;
while(c = getchar(), c <
'0' || c >
'9')
if(c ==
'-') op =
1;
x = c -
'0';
while(c = getchar(), c >=
'0' && c <=
'9')
x = x *
10 + c -
'0';
if(op) x = -
x;
}
template <
class T>
void write(T x){
if(x <
0) putchar(
'-'), x = -
x;
if(x >=
10) write(x /
10);
putchar('0' + x %
10);
}
转载于:https://www.cnblogs.com/DukeLv/p/9394055.html
相关资源:数据结构—成绩单生成器
转载请注明原文地址: https://win8.8miu.com/read-1481139.html