1. 程式人生 > >noip2011——普及組——數字反轉

noip2011——普及組——數字反轉

har iostream ret name getc lin int com ()

傻逼題,不講了。

#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cstring>
using namespace std;
int t=1,num=0;char c=getchar();
inline int read(){
    while(c>9||c<0){if(c==-)t=-1;c=getchar();}
    while(c>=0&&c<=9){num=num*10+c-0;c=getchar();}
    
return num; } int main() { int a=read(),b=0; while(a){ b=b*10+(a%10); a/=10; } printf("%d",b*t); return 0; }

本文由Yzyet編寫,網址為www.cnblogs.com/Yzyet。非Yzyet同意,禁止轉載,侵權者必究。

noip2011——普及組——數字反轉