标签:
scanf很快
但是getchar更快~
输入挂(有时能用上):
1 int read(){ 2 int res = 0; 3 char c; 4 while(c=getchar(), c<‘0‘||c>‘9‘); 5 res = c-‘0‘; 6 while( c=getchar(),c>=‘0‘&&c<=‘9‘ ) res = res*10+c-‘0‘; 7 return res; 8 }
标签:
原文地址:http://www.cnblogs.com/llkpersonal/p/4542895.html