Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <math.h>
- #include <stdio.h>
- #include <stdlib.h>
- #include <string>
- #include <time.h>
- #include <windows.h>
- #include <conio.h>
- #include "klasa_1.h"
- #include "parzyste.h"
- #include "r_kwadratowe.h"
- using namespace std;
- int choice;
- char ctcp; //choice to close program
- void Wybor() //Menu programu
- {
- cout<<"1. Kalkulator \n";
- cout<<"2. Ilosc parzystych na N liczb \n";
- cout<<"3. Rownanie kwadratowe \n";
- cout<<endl<<"Wybor: ";
- cin>>choice;
- cout<<endl;
- }
- void wProgram()
- {
- cout<<"Czy chcesz wylaczyc program? Jesli tak wpisz (T lub t), jednak jezeli chcesz chcesz wylaczyc wpisz (N lub n)"<<endl;
- cout<<"Wybor: ";
- ctcp = getch();
- if(ctcp == 'T' || ctcp == 't')
- {
- cout<<endl<<endl<<"Trwa wylaczanie programu";
- Sleep(2000);
- exit(0);
- }
- else if(ctcp == 'N' || ctcp == 'n')
- {
- system("cls");
- }
- else exit(0);
- }
- int main()
- {
- Wybor();
- Kalkulator k1(1,1,2,0);
- Parzyste p1(1,1);
- rKwadratowe rk1(1,1,1,1,1,1);
- if(choice == 1)
- {
- for(;;)
- {
- Kalkulator k1(1,1,2,0);
- k1.kWyciagnij();
- k1.kMenu();
- k1.kOblicz();
- k1.kPokazWynik();
- getchar();getchar();
- wProgram();
- }
- }
- else if(choice == 2)
- {
- for(;;)
- {
- p1.l_parzystych=0;
- p1.pWyciagnijIlosc();
- p1.pObliczIlosc();
- p1.pPokazIlosc();
- getchar();getchar();
- wProgram();
- }
- }
- else if(choice == 3)
- {
- for(;;)
- {
- rk1.rkPodajLiczby();
- rk1.rkOblicz();
- rk1.rkWyswietl();
- getchar();getchar();
- wProgram();
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement