Advertisement
alex326

Untitled

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