fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. int n=1, k, zbir=0, broj;
  6. cin>>k;
  7. do
  8. {
  9. cin>>broj;
  10. zbir=zbir+broj;
  11.  
  12. n++;
  13. }
  14. while(n<=k);
  15. cout<<zbir;
  16. return 0;
  17. }
Success #stdin #stdout 0s 4524KB
stdin
4
7 2 13 8 

stdout
30