Guest User

Untitled

a guest
Jan 16th, 2019
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. #include <cstdlib>
  2. #include <iostream>
  3.  
  4. using namespace std;
  5.  
  6. int main(int argc, char *argv[])
  7. {
  8. int n;
  9. int n1;
  10. char stringsx[256];
  11.  
  12. cout<<"Enter numbers. 'g' to end."<<endl;
  13.  
  14. do
  15. {
  16. gets (stringsx);
  17. n=atoi(stringsx);
  18.  
  19. n1+=n;
  20. }
  21.  
  22. while (stringsx!="g");
  23.  
  24. cout<<"ending"<<endl;
  25. cout<<n1;
  26.  
  27. system("PAUSE");
  28. }
  29.  
  30. //while (!((cin >> n).rdstate() & ifstream::failbit)) { n2 += n; }
Add Comment
Please, Sign In to add comment