Advertisement
Guest User

Untitled

a guest
Nov 21st, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.19 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. /*
  6.  
  7. */
  8. int sumaliczb(int a, int b);
  9. int main(int argc, char** argv) {
  10. /*
  11. int liczbaPierwsza =0;
  12. int liczbaDruga =0;
  13. int kalkulator =0;
  14. int wynik =0;
  15. int sumaLiczb =0;
  16. */
  17. int kalkulator =0;
  18. int l1=0, l2=0, l3=0;
  19.  
  20. cout <<"Wybierz menu"<<"\n";
  21. cout <<"1 - Dodawanie"<<"\n";
  22. cout <<"2 - Odejmowanie"<<"\n";
  23. cout <<"3 - Mnozenie"<<"\n";
  24. cout <<"4 - Dzielenie"<<"\n";
  25. cin >>kalkulator;
  26. switch(kalkulator)
  27. {
  28. case 1:
  29.  
  30. cout << "Podaj pierwsza liczbe =";
  31. cin >> l1;
  32.  
  33. cout << "Podaj druga liczbe =";
  34. cin >> l2;
  35.  
  36. l3=sumaliczb(l1,l2);
  37.  
  38. cout << endl << "SUMA WYNOSI:" << endl;
  39. cout << l1 << "+" << l2 << "=" << l3 << endl << endl;
  40.  
  41. system ("Pause");
  42. /*
  43. cout <<"Podaj pierwsza liczbe: ";
  44. cin >>liczbaPierwsza;
  45. cout <<"Podaj druga liczbe: ";
  46. cin >>liczbaDruga;
  47.  
  48.  
  49. sumaLiczb(liczbaPierwsza,liczbaDruga);
  50. cout << endl << "SUMA WYNOSI:" << endl;
  51. cout <<liczbaPierwsza << "+" << liczbaDruga << "=" <<sumaLiczb<<"\n";
  52. */
  53. break;
  54. case 2:
  55. cout<<"mleko";
  56. break;
  57. return 0;
  58. }
  59. }
  60. int sumaLiczb(int a, int b)
  61. {
  62. return a+b;
  63. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement