#include <iostream>
using namespace std;
unsigned __int64 mul(char* a,char*b){
unsigned __int64 r=0;
for(;*a;++a) {
if(*a=='0')continue;
for(char* c=b;*c;++c) {
r+=(*a-'0')*(*c-'0');
}
}
return r;
}
int main()
{
for(char a[16],b[16];cin>>a>>b;cout<<mul(a,b)<<endl);
return 0;
}
Saturday, 21 March 2009
POJ ( acm.pku.edu.cn ) 3673
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment