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 <string.h> using namespace std; int main() { char a[10],b[10]; long sum=0; int m,n; cin>>a>>b; m=strlen(a); n=strlen(b); for(int i=0;i<m;i++) a[i]=a[i]-'0'; for(int j=0;j<n;j++) b[j]=b[j]-'0'; for(int k=0;k<m;k++) for(int j=0;j<n;j++) sum+=a[k]*b[j]; cout<<sum<<endl; return 0; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator