POJ 2316
1 #include<iostream> 2 #include<stdio.h> 3 #include<string> 4 using namespace std; 5 6 int poo[10]; 7 int main() 8 { 9 //freopen("acm.acm","r",stdin); 10 memset(poo,0,sizeof(int)*10); 11 int num; 12 int i; 13 string s; 14 cin>>s; 15 num = s.length(); 16 for(i = 0; i < num; ++ i) 17 { 18 poo[i] += s[i] - '0'; 19 } 20 while(cin>>s) 21 { 22 for(i = 0; i < num; ++ i) 23 { 24 poo[i] += s[i] - '0'; 25 } 26 } 27 for(i = 0; i < num; ++ i) 28 { 29 cout<<poo[i]%10; 30 } 31 32 }