Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- float a, b;
- int d, e;
- char c;
- while(1)
- {
- cout<<"Viberite kod simvola:\n1.Calc\n2.Vihod\n";
- cin>>e;
- d=1;
- while(d==1)
- switch(e)
- {
- case 1:d=0;break;
- case 2:return 0;
- default: cout<<"Nepravil'niy simvol... Povtorite vvod...\n";
- }
- cout << "Vvedite 2 chisla" << endl;
- cin>>a>>b;
- cout<<"Viberite 1 iz 4 operaciy...\n1.+\n2.-\n3.*\n4./\n";
- cin>>c;
- while(d==0)
- {
- d=1;
- switch(c)
- {
- case '+': cout<<a+b; break;
- case '-': cout<<a-b; break;
- case '*': cout<<a*b; break;
- case '/': if(b!=0) cout<<a/b; else cout<<"Delenie na 0 nevozmozhno"; break;
- default: d=0;cout<<"Nepravil'niy simvol... Povtorite vvod...";
- }
- cout<<endl;
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement