Advertisement
Guest User

Untitled

a guest
Dec 10th, 2019
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.55 KB | None | 0 0
  1. #include <cstdlib>
  2. #include <iostream>
  3. #include <windows.h>
  4. #include <cmath>
  5. #include <conio.h>
  6. #include <stdio.h>
  7. using namespace std;
  8. void gotoxy(int x, int y)
  9. {
  10.  
  11. COORD c;
  12. c.X=x - 1;
  13. c.Y = y -1;
  14. SetConsoleCursorPosition (GetStdHandle(STD_OUTPUT_HANDLE), c);
  15. }
  16.  
  17. void menu();
  18. void litery();
  19. void cyfry();
  20. void losowe();
  21. void litery();
  22. int wybor;
  23.  
  24. char a='a';
  25. int m=0;
  26. int p=0;
  27. int w=0;
  28. int k=0;
  29. char g;
  30. int main(int argc, char *argv[])
  31. {
  32. cout << "podaj znak: ";
  33. cin >> g;
  34. menu();
  35. return EXIT_SUCCESS;
  36. }
  37.  
  38.  
  39.  
  40. void menu()
  41. {
  42. cout << "###################### "<<endl;
  43. cout << "# Witaj! # "<<endl ;
  44. cout << "# Wybierz madrze # " <<endl;
  45. cout << "# [1] litery # "<<endl ;
  46. cout << "# [2] Cyfry # " <<endl;
  47. cout << "# [3] Losowe # " <<endl;
  48. cout << "###################### " <<endl;
  49. wybor=getch();
  50. if(wybor=='1')
  51. {
  52. litery();
  53. }
  54. if(wybor=='2')
  55. {
  56. cyfry();
  57. }
  58.  
  59. if(wybor=='3')
  60. {
  61. losowe();
  62. }
  63. }
  64.  
  65. void litery(){
  66. system("CLS");
  67. system("color a");
  68. gotoxy(1,1);
  69. for(p=0; p<5; p++){
  70. for(int i=0x41; i<=0x5A; ++i){
  71. printf("%c",i);
  72. }
  73. }
  74. gotoxy(1,2);
  75. for(int u=0; u<2;u++){
  76. for(int i=0x41; i<=0x5A; ++i){
  77. printf("%c A \n",i);
  78. } }
  79.  
  80. gotoxy(1,30);
  81. for(w=0; w<5; w++){
  82. for(int i=0x41; i<=0x5A; ++i){
  83. printf("%c",i);
  84. }
  85. }
  86. gotoxy(16,16);
  87. cout <<"Pan Zurawski jest nalepszy";
  88. gotoxy(1,1);
  89.  
  90. getch();
  91.  
  92. }
  93.  
  94.  
  95.  
  96. void cyfry()
  97. {
  98. system("color d");
  99. system("CLS");
  100. int l=0;
  101. for(;l<64;l++){
  102. cout << l;
  103. }
  104.  
  105. //petla zeby bylo od 0-9
  106. int z=0;
  107. for(;z<3;z++){
  108. int c=0;
  109. cout << "1"<<endl;
  110. //petla piszaca 0-9
  111. for(;c<9;c++){
  112. cout << c<< " "<<c<<endl;
  113. }
  114. }
  115. gotoxy(1,30);
  116. for(;m<64;m++){
  117. cout <<m;
  118. }
  119. gotoxy(119,30);
  120. cout << g;
  121. gotoxy(119,11);
  122. cout<<g;
  123. gotoxy(119,21);
  124. cout<<g;
  125. gotoxy(1,30);
  126. cout << g;
  127. gotoxy(1,1);
  128. cout << g;
  129. gotoxy(119,1);
  130. cout << g;
  131. gotoxy(16,16);
  132. cout <<"Pan Zurawski jest nalepszy";
  133. gotoxy(1,1);
  134. getch();
  135.  
  136. }
  137.  
  138. void losowe(){
  139. cout << "loowe";
  140. getch();
  141.  
  142. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement