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<stdio.h> #include<string.h> main() { char a[10],b[10]; int i,m,n,j; long sum=0; scanf("%s %s",a,b); m=strlen(a); n=strlen(b); for(i=0;i<m;i++) a[i]=a[i]-'0'; for(i=0;i<n;i++) b[i]=b[i]-'0'; for(i=0;i<m;i++) { for(j=0;j<n;j++) { sum=sum+a[i]*b[j]; } } printf("%ld\n",sum); } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator