Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <cstdlib>
- #include <iostream>
- using namespace std;
- int main(int argc, char *argv[])
- {
- int n;
- int n1;
- char stringsx[256];
- cout<<"Enter numbers. 'g' to end."<<endl;
- do
- {
- gets (stringsx);
- n=atoi(stringsx);
- n1+=n;
- }
- while (stringsx!="g");
- cout<<"ending"<<endl;
- cout<<n1;
- system("PAUSE");
- }
- //while (!((cin >> n).rdstate() & ifstream::failbit)) { n2 += n; }
Add Comment
Please, Sign In to add comment