提交时间:2023-08-14 11:58:37
运行 ID: 98073
#include<bits/stdc++.h> using namespace std; #define int unsigned long long int n,a[200001],ans; inline int f(int x) { int ans=0; while(x){ ans+=x%10; x/=10; } return ans; } signed main() { cin>>n; for(int i=1;i<=n;i++) cin>>a[i]; for(int i=1;i<=n;i++){ int sk=0; for(int j=1;j<=n;j++) sk+=f(a[j]+a[i]); ans+=sk; } cout<<ans<<endl; return 0; }