Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include<math.h>
- using namespace std;
- int main ()
- {
- int obecnie2;
- int pot2;
- int silnia;
- int cont;
- float reszta;
- int razem = 0;
- int liczba;
- int obecnie = 1;
- int dzialanie;
- float x;
- float y;
- int obecnie3;
- float wynik;
- cont = 1;
- while (cont == 1){
- cout << "KALKULATOR BY RECZEK" << endl;
- cout << "Co chcesz dzisiaj policzyc?" << endl;
- cout << " Dodawanie 1" << endl;
- cout << " Odejmowanie 2" << endl;
- cout << " Mnozenie 3" << endl;
- cout << " Dzielenie 4" << endl;
- cout << " Pierwiastek kwadratowy 5" << endl;
- cout << " Dzielniki 6" << endl;
- cout << " Potegi 7" << endl;
- cout << " Silnia 8" << endl;
- cout << " Pierwiastek x stopnia 9" << endl;
- cin >> dzialanie;
- if(dzialanie ==1){
- cout << "Podaj pierwsza liczbe: " << endl;
- cin >> x ;
- cout << endl;
- cout << "Podaj druga liczbe: " << endl;
- cin >> y;
- wynik = x+y;
- cout << "Wynik: " << wynik ;}
- if(dzialanie == 2){
- cout << "Podaj pierwsza liczbe: " << endl;
- cin >> x ;
- cout << endl;
- cout << "Podaj druga liczbe: " << endl;
- cin >> y;
- wynik = x-y;
- cout << "Wynik: " << wynik;}
- if(dzialanie ==3){
- cout << "Podaj pierwsza liczbe: " << endl;
- cin >> x ;
- cout << endl;
- cout << "Podaj druga liczbe: " << endl;
- cin >> y;
- wynik = x*y;
- cout << "Wynik: " << wynik;}
- if(dzialanie ==4){
- cout<<"Podaj pierwsza liczbe: " << endl;
- cin >> x ;
- cout << endl;
- cout << "Podaj druga liczbe: " << endl;
- cin >> y;
- wynik= x/y;
- cout << "Wynik: " << wynik;}
- if(dzialanie == 5){
- cout << "Podaj liczbe: " << endl;
- cin >> x ;
- cout << endl;
- wynik = sqrtf(x);
- cout << "Wynik: " << wynik;
- }
- if (dzialanie ==6){
- cout << "Podaj liczbe: " << endl;
- cin >> liczba;
- if(liczba>0){
- cout << "Dzielniki: ";
- for(;obecnie <= liczba; obecnie++){
- reszta = liczba % obecnie;
- if(reszta == 0){
- cout << obecnie << " ";
- razem++;
- }
- }cout << endl << "Ilosc dzielnikow: " << razem;
- obecnie =1;
- }
- }
- if (dzialanie == 7){
- cout << "Podaj liczbe: " << endl;
- cin >> x;
- cout << "Podaj potege: " << endl;
- cin >> y;
- pot2 = x;
- if (x!= 0 and y >0){
- for(int potega = 1; potega < y; potega++){
- wynik = pot2*x;
- x = pot2*x;
- }
- cout << "Wynik: " << wynik;
- }else{
- if (y==0){
- cout << "Wynik: 1";
- }
- if(x==0){
- cout << "Wynik: 0";
- }
- }
- }
- if(dzialanie==8){
- cout << "Podaj liczbe: " << endl;
- cin >> x;
- if(x>0){
- for(wynik=1;x>0;x--){
- wynik=wynik*x;
- }
- }else{
- if(x==0){
- cout <<"Wynik: 0" << endl;
- }else{
- for(wynik=1;x<0;x++){
- wynik=wynik*x;
- }
- }
- }cout<<"Wynik to: " << wynik << endl;}
- if(dzialanie==9){
- cout << "Podaj liczbe: " << endl;
- cin >> x;
- cout << "Podaj stopien pierwiastka: " << endl;
- cin >> y;
- for(obecnie =1; obecnie <=x; obecnie++){obecnie3=1;
- for(obecnie2=1; obecnie2<=y; obecnie2++){
- obecnie3=obecnie3*obecnie;
- }
- if(obecnie3==x){
- wynik=obecnie3;
- }
- cout << "Wynik to: " << wynik;
- }
- }
- if (dzialanie == 666 or dzialanie == 2137){
- cout << ";;;;;;;;;:::::::::::,,,,,,,........````````````````````````````..........,,,,,,,,::::::::::::" << endl;
- cout << ";;;;;;;;;:::::::::,,,,,,,,.........`````````````````````````````..........,,,,,,,,:::::::::::" << endl;
- cout << ";;;;;;;;::::::::::,,,,,,,.......````````````````````````````````````.......,,,,,,,:::::::::::" << endl;
- cout << ";;;;;;;;::::::::,,,,,,,.......```````````` `` ```````````````````.......,,,,,,,::::::::::" << endl;
- cout << ";;;;;;::::::::::,,,,,,.......``````````` ` ` ` ``````````````.......,,,,,,::::::::::" << endl;
- cout << ";;;;;;::::::::::,,,,,.......``````````````` `,,,...````` ````````````......,,,,,,,:::::::::" << endl;
- cout << ";;;:::::::::::,,,,,,,......`````````````` ,;:,,,. .```````` ``````````.....,,,,,,,,::::::::" << endl;
- cout << ";:::::::::::::,,,,,,......`````````` . ;;::,,,....````.`` ```````````......,,,,,,,:::::::" << endl;
- cout << ";::::::::::::,,,,,,,.....```````` ` ``.;+;,,;''';:,::::.``. `` ````````......,,,,,,:::::::" << endl;
- cout << ";::::::::::::,,,,,,.....````````` ``,;:+##++';'::,,,,.,+, ` ````````......,,,,,,,::::::" << endl;
- cout << ";:::::::::::,,,,,.......```````` `+'#+';';;;;;:,,,,..,.:':` ` ````````.....,,,,,,:::::::" << endl;
- cout << ";::::::::::,,,,,,......``````` `` ++:'';;;;;:::;,,,......,,;. ````````......,,,,,,:::::" << endl;
- cout << "::::::::::::,,,,,.....```````` @'';'''';;;:;:,,,,.,..,.,,,.` ```````......,,,,,::::::" << endl;
- cout << ":::::::::::,,,,,......```````` ;'';''';;;;:::::,,,..,.,,,,,.,` ```````......,,,,,,:::::" << endl;
- cout << ":::::::::::,,,,,,.....``````` ` .#+'''';;;;:;:::::,,,,,.,.,,,,.. `````````.....,,,,,,,::::"<< endl;
- cout << ":::::::::::,,,,,.......`````` ` #+'+''''';;;::::,:,,.,.,,,...,.`. ` ``````.....,.,,,,:::::"<< endl;
- cout << ":::::::::::,,,,,.....`.``````` `;++++''+';';;;:::,:,........,...,.. ```````......,,,,,::::"<< endl;
- cout << ":::::::::::,,,,,.....````````` #+++++'+;''';:::,,,,,,,,,....,,,,., `````````.....,,,,,::::"<< endl;
- cout << "::::::::::,,,,,,.....```````` `@++++'++''''';:,,,,,,,,,,,..,,..,,,. ````````......,,,,,:::"<< endl;
- cout << "::::::::::,,,,,,.....``````` ++++++'+''++;;;;,,,,,,,,,,,,,,,,,,:, ```````......,,,,,:::"<< endl;
- cout << ":::::::::,,,,,,.....``````` ` ,@+++'++++'';;;:,.:,,,,,,,,,,,,,,,,:, ````````.....,,,,,,::"<< endl;
- cout << "::::::::::,,,,,.....``````` ` ;+'+++'++''';;;:,:.:::::::.,,,,,,,,:` ````````.....,,,,,,::"<< endl;
- cout << "::::::::::,,,,,.....``````` ++'++'+'''+''';;,,;::,,,.,,,,,,,,:; ````````.....,,,,,,::"<< endl;
- cout << ":::::::::,,,,,,....```````` `##.++'+'+++''''';;:,::,,,,,::,,,,,:::; ````````.....,,,,,,::"<< endl;
- cout << ":::::::::,,,,,,....```````` '''#+'+++++'';;;;'::,,::::,,.,:,:,::;. ````````.....,,,,,,::"<< endl;
- cout << ":::::::::,,,,,,....```````` .+++#+'++++'+++'';;':,;:;::,:.:,::,,:; ````````.....,,,,,,::"<< endl;
- cout << ":::::::::,,,,,,....```````` :++++#++++#+++++#++'';::;::::,,,,,,,::`` ```````.....,,,,,,::"<< endl;
- cout << ":::::::::,,,,,,....```````` `#;+++++++#+''':;;++':::;;;;;::,,,,,,,: ````````.....,,,,,,::"<< endl;
- cout << ":::::::::,,,,,,....```````` +'+++++++++'###;#+##':':;++';:::,,,,:; ````````.....,,,,,,::"<< endl;
- cout << ":::::::::,,,,,,....```````` `@;+++++++':++':';'++'::'++#+;;;:,.,.,: ````````.....,,,,,,::"<< endl;
- cout << ":::::::::,,,,,,....```````` .'+++++++';:+';;;:''',::;+'+'#::.,,:,` ````````.....,,,,,,::"<< endl;
- cout << ":::::::::,,,,,,.....```````` +'#++++'';;:;;;;:'',,,:;''::,+;,,,;. ```````.....,,,,,,,::"<< endl;
- cout << ":::::::::,,,,,,.....``````` #'+++++''';;:::;;'':.,,,:;::,,.,:,:, ```````......,,,,,:,"<< endl;
- cout << ":::::::::,,,,,,.....``````` ` #++++++''';::::;'+':,,,,:,..,,,,,,,.`` ```````......,,,,,,,"<< endl;
- cout << ":::::::::,,,,,,......```````` `''+++++''';;:::;++;,,:,:::,:,,,,,:, ````````......,,,,,,,,"<< endl;
- cout << ":::::::::,,,,,,......```````` #+++++++'';::;'+#;,,:::::,.,,,,,., ````````......,,,,,,,:"<< endl;
- cout << "::::::::,,,,,,,.......``````` `'#+++++''';+'';+;,,,,;;::,,,,,,,` ````````.....,,,,,,,,:"<< endl;
- cout << ":::::::::,,,,,,.......``````` `@+++++'''';;#++;:,,,;';::::,,:: ````````.....,,,,,,,,,"<< endl;
- cout << ":::::,,,:,,,,,,.......``````` .#+++++''+'''+#++':::,:+;:::,,;`` ```````......,,,,,,,,,"<< endl;
- cout << ":::::,,,,,,,,,,,,.....````` ` ```,+#+++++';';+'+###+;,,,:'';:::,` ````````.......,,,,,,,,,"<< endl;
- cout << ":::::::::,,,,,,,,.....``````` `;##+#+++++;:'+'''++;;,,,,,:+;;:,` ````````.........,,,,,,,"<< endl;
- cout << ":::::::::,,,,,,,,......````.`@##+++++++'+;:;##''';:;:,,,,:;:::;` ` ````````..........,,,,::"<< endl;
- cout << ":::::::::,,,,,,,,......````.@#+#+++++++'+':'''+###;;;::;+;::::. ` ```````...........,,,,,,"<< endl;
- cout << ":::::::::,,,,,,,,.......`.`.+'#++++#++#'++;;+'+';,:,...,;::,;:``` `````````........`...,,,,,"<< endl;
- cout << ",:::::::::,,,,,,,........` #+##++'+++++'++';'''++';:::,,:,:,,, `````````..............,,,,"<< endl;
- cout << "::::::::,:,,,,,,,,........'++++#+'++++#+++'';';';;;::::,,:,;: ` `````````............,,,,,,"<< endl;
- cout << "::::::::,:,,,,,,,,,.,.....++++++#'+++++++++';;;:;:,.,,::,:,;``````````````.......,,..,,.,,,,,"<< endl;
- cout << "::::::::::::,,,,,,,.,.`.,##+++++++++++++++++';:''::,,,:,:::`` ```````````........,,,,.,,,,,,,"<< endl;
- cout << ",:::::::::::,,,,,,,,.,`@+++'+++'+++'#++++++++;;'';:,:,,:,;+ ```````````.......,,,,,,,,,,,,::"<< endl;
- cout << ",,::::::::::,,,,,,,,,:+#+++'''+''++#'+++++++'+;';;;::,,:;;#: `````````.......,,,,,,:,,:,::::"<< endl;
- cout << ",,,,,,,,,,,,,,,,,,,`++++++''+'''++'+#++++++++''''';+;;::',:+``````````........,,,,,,,::::::::"<< endl;
- cout << ",,,,,..,,,,,,,:,,,,#+++'+++''''''+''+++++++''+#';''+':;,+ .';;```````.......,,,,,,,,:::::::::"<< endl;
- cout << ":,,,...,,,,,,,:,,#+''';#+'#++;'''''''++#'+''''''+####::, `'#''''`.``........,,,,,,:::::::::::"<< endl;
- cout << ":,,,,..,,,,,,,:,@+;#';,';`+#+''''''''''+#+'''''';;;:``.`:..#''';'++:.`.....,,,,,,,,::::::::::"<< endl;
- cout << ":,,,,,,,,,,,::++###+#+#','+.'''''+''''+'++'';;;:::;..`.,. :#';:+#,,+.....,,,,,,,,,::::::::::"<< endl;
- cout << "::,,::::::,;,##++'+''##@'':':#+'++;''+'+'+.;;:::,,,.`.`,.``.:;''+':':;,..,,,,,,,,,,,:::::::::"<< endl;
- }
- if(dzialanie<1){
- cout << "SERIO. CO CHCESZn OSIAGNAC?!"; }
- if(dzialanie > 8 and dzialanie != 666 and dzialanie != 2137){
- cout << ";-)"; }
- cout << endl;
- cout << "Czy chcesz kontynuowac? 1 - tak" << endl;
- cin >> cont;
- }
- cout << "Reczek pozdrawia";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement