Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cstdlib>
- #include <conio.h>
- #include <stdio.h>
- using namespace std;
- int main()
- {
- float x, y;
- for(;;)
- {
- cout << "Podaj x i y" << endl;
- cout<<"x= ";
- cin>>x;
- cout<<"y= ";
- cin>>y;
- cout<<"MENU GLOWNE"<<endl;
- cout<<"************"<<endl;
- cout<<"1. Dodawanie"<<endl;
- cout<<"2. Odejmowanie"<<endl;
- cout<<"3. Mnozenie"<<endl;
- cout<<"4. Dzielenie"<<endl;
- cout<<"4. Dzielenie"<<endl;
- cout<<"5. Komiec"<<endl;
- char wybor;
- cout<<"Podaj numer dzialania: ";
- wybor=getch();
- switch(wybor)
- {
- case '1':
- {
- cout<<"Suma to "<<x+y;
- break;
- }
- case '2':
- {
- cout<<"Roznica to to "<<x-y;
- break;
- }
- case '3':
- {
- cout<<"Iloczyn to "<<x*y;
- break;
- }
- case '4':
- {
- if(y==0)
- {
- cout<<"Nie dzilimy przez 0"<<endl;
- }
- else
- {
- cout<<"Iloraz to "<<x/y;
- }
- break;
- }
- case '5':
- {
- exit(0);
- }
- default:
- {
- cout<<"\n\n\ Brak opcji w MENU" <<endl;
- }
- }
- getchar();getchar();
- system("cls");
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement