Advertisement
Guest User

Untitled

a guest
May 22nd, 2019
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.08 KB | None | 0 0
  1. #include <iostream>
  2. #include <cstdlib>
  3. #include <ctime>
  4. #include <stdio.h>
  5. #include <stdlib.h>
  6. #include <ctype.h>
  7. #include <conio.h>
  8. using namespace std;
  9. void menu()
  10. {
  11. cout<<"[1]Wczytaj"<<endl;
  12. cout<<"[2]Wyswietl"<<endl;
  13. cout<<"[3]srednia i suma"<<endl;
  14. cout<<"[4]minimalny i maksymalny"<<endl;
  15. cout<<"[5]od najmniejszego"<<endl;
  16. cout<<"[6]nad i pod srednia"<<endl;
  17. cout<<"[7]koniec"<<endl;
  18. }
  19. void wczytaj()
  20. {
  21. int i;
  22. int tab[i];
  23.  
  24. int dochod;
  25.  
  26. cout<<"podaj kolejne dochody"<<endl;
  27. for(i=0;i<4;i++)
  28. {
  29. cout<<"podaj dochod nr."<<i<<":";
  30. cin>>tab[i];
  31.  
  32. }
  33.  
  34. }
  35. void wyswietl()
  36. {
  37. int i,tab[i];
  38. for(i=0;i<4;i++)
  39. {
  40. cout<<"dochod nr."<<i<<":"<<tab[i]<<endl;
  41. }
  42. cout<<( "\nNacisnij Enter by powrocic do menu...")<<endl;
  43. getch();
  44. }
  45.  
  46. int main(int argc, char** argv)
  47. {
  48. int klawisz,i,dochod;
  49.  
  50. do{
  51.  
  52.  
  53.  
  54. menu();
  55. klawisz = tolower( getchar() );
  56.  
  57. switch(klawisz)
  58. {
  59. case '1': wczytaj();
  60. break;
  61. case '2': wyswietl();
  62. break;
  63. default : if(klawisz != 'z')
  64. putchar('\a');
  65. break;
  66. }
  67. system("CLS");
  68. }while(klawisz !='z');
  69. return 0;
  70. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement