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

WA,无奈中

Posted by Pro_zq at 2009-08-27 15:12:55 on Problem 3673
#include <stdio.h>
#include <string.h>

int main()
{
    char n1[20 + 1], n2[20 + 1];
    
    int s;
    
    int i, j;
    
    scanf("%s%s", n1, n2);
    for(i = 0; i < strlen(n1); ++i)
    {
        n1[i] -= '0';      
    }
    for(i = 0; i < strlen(n2); ++i)
    {
        n2[i] -= '0';      
    }
    
    s = 0;
    for(i = 0; i < strlen(n1); ++i)
    {
        for(j = 0; j < strlen(n2); ++j)
        {
            s += n1[i] * n2[j];
        }      
    }
    
    printf("%d\n", s);
    
    return 0;
}

这个错哪儿了 = =||
希望牛人指点下

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