| ||||||||||
Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
直接用库函数,水过。。。。。#include<iostream> #include<algorithm> using namespace std; int main(void) { int t; scanf("%d",&t); while(t--) { int a,b; char s1[13],s2[13]; scanf("%d%d",&a,&b); sprintf(s1,"%d",a); sprintf(s2,"%d",b); reverse(s1,s1+strlen(s1)); reverse(s2,s2+strlen(s2)); sscanf(s1,"%d",&a); sscanf(s2,"%d",&b); sprintf(s1,"%d",a+b); reverse(s1,s1+strlen(s1)); sscanf(s1,"%d",&a); printf("%d\n",a); } return 0; } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator