Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

各位老大帮帮忙 哪错了

Posted by 00liuqing at 2007-03-24 22:23:16 on Problem 1504
#include<stdio.h>
int f(int x);
int main()
{
    int n,a,b;
    scanf("%d",&n);
    while(n)
    {
       scanf("%d%d",&a,&b);
       a=f(a);b=f(b);
       a=a+b;
       a=f(a);
       printf("%d\n",a);
       n--;
    }
    return 1;
}
       
int f(int x)
{ 
    int a=x,t=1,i,j;
    for(i=0;a;i++)
    {a=a/10;t*=10;}
    a=0;
    for(j=0;j<i;j++)
    {a=x%10*t/10+a;t/=10;x/=10;}
    return a;
}
  

Followed by:

Post your reply here:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator