Advertisement
Guest User

Untitled

a guest
Sep 18th, 2019
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.33 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. setlocale (LC_ALL, "Russian");
  8.  
  9.     int chiselko = 0;
  10.     int sum= 0;
  11.     do
  12.  
  13.     {
  14.   cin>> chiselko;
  15. if (!cin)
  16. {
  17. cout<<("Не число");
  18. return 1;
  19. }
  20.   sum= sum+chiselko;
  21.     }
  22.  while (chiselko!=0 );
  23.  cout<< "Сумма чисел = "<<sum;
  24.     return 0;
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement