标签:csharp tchar put for arp pre log nbsp blog
template<class T> inline bool getd(T& x)
{
int ch=getchar();
bool neg=false;
if(ch!=EOF && ch!=‘-‘ && !isdigit(ch)) ch=getchar();
if(ch==EOF) return false;
if(ch==‘-‘){
neg=true;
ch=getchar();
}
x=ch-‘0‘;
while(isdigit(ch=getchar())) x=x*10+ch-‘0‘;
if(neg) x=-x;
return true;
}
template<class M> inline void putd(M x)
{
int p=0;
if(x<0){
putchar(‘-‘);
x=-x;
}
do{
buf[p++]=x%10;
x/=10;
}while(x);
for(int i=p-1;i>=0;i--) putchar(buf[i]+‘0‘);
putchar(‘\n‘);
}
标签:csharp tchar put for arp pre log nbsp blog
原文地址:http://www.cnblogs.com/tsingyawn/p/6159191.html