Advertisement
alex326

Untitled

Jan 22nd, 2018
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.24 KB | None | 0 0
  1. problema 127
  2.  
  3. #include <iostream>
  4. using namespace std;
  5. int main()
  6. {
  7. int n,a,s=0;
  8. cin>>n;
  9. while (n!=0){
  10. cin>>a;
  11. while (a>9){
  12. a=a/10;
  13. }
  14. s=s+a;
  15. n--;
  16. }
  17. cout<<s;
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement