Run ID | 作者 | 问题 | 语言 | 测评结果 | 时间 | 内存 | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
33256 | U•ェ•*✔ | 【USACO】奶牛式乘法 | C++ | 解答错误 | 0 MS | 244 KB | 308 | 2023-12-24 14:42:49 |
#include"bits/stdc++.h" using namespace std; int n[100],m[100]; int main(){ int a,b,t=0,p=0,ans=0; cin>>a>>b; while(a){ n[t]+=a%10; a/=10; t++; } while(b){ m[p]+=b%10; b/=10; p++; } for(int i=0;i<t;i++){ for(int j=0;j<p;j++){ ans+=n[i]*m[j]; } } cout<<ans; }