Advertisement
Guest User

informatyka

a guest
Feb 19th, 2020
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.87 KB | None | 0 0
  1. KWADRAT
  2.  
  3.  
  4.  
  5. #include <iostream>
  6. using namespace std;
  7. int main()
  8. {
  9. int h;
  10. cin>>h;
  11. for(int n=1;n<=h;n++)
  12. {
  13.  
  14. for(int k=1; k<=n;k++)
  15. cout<<"X";
  16. for(int i=1; i<=h-n;i++)
  17. cout<<"X";
  18. cout<<endl;
  19. }
  20. return 0;
  21. }
  22.  
  23. CHOINKA
  24.  
  25.  
  26.  
  27. #include <iostream>
  28. using namespace std;
  29. int main()
  30. {
  31. int n;
  32. cout<<"Z ilu linii ma skladac sie choinka?"<<endl;
  33. cin>>n;
  34.  
  35.  
  36. for(int b=1;b<=n;b++)
  37. {
  38. for(int c=1;c<=n-b;c++)
  39. {
  40. cout<<" ";
  41. }
  42. for(int c=1;c<=b*2-1;c++)
  43. {
  44. cout <<"+";
  45. }
  46. cout<<endl;
  47. }
  48.  
  49.  
  50.  
  51. for(int d=1;d<=2;d++)
  52. {
  53. for(int d=1;d<=n-1;d++)
  54. {
  55. cout <<" ";
  56. }
  57. cout<<"#\n";
  58. }
  59.  
  60. return 0;
  61. }
  62.  
  63. SCHODY W LEWO
  64.  
  65.  
  66.  
  67. #include <iostream>
  68. using namespace std;
  69. int main()
  70. {
  71. int h;
  72. cin>>h;
  73. for(int n=1;n<=h;n++)
  74. {
  75.  
  76. for(int k=1; k<=n;k++)
  77. cout<<"X";
  78. for(int i=1; i<=h-n;i++)
  79. cout<<" ";
  80. cout<<endl;
  81. }
  82. return 0;
  83. }
  84.  
  85.  
  86.  
  87. SCHODY W PRAWO
  88.  
  89.  
  90.  
  91. #include <iostream>
  92. using namespace std;
  93. int main()
  94. {
  95. int h;
  96. cin>>h;
  97. for(int n=1;n<=h;n++)
  98. {
  99. for(int i=1; i<=h-n;i++)
  100. cout<<" ";
  101. for(int k=1; k<=n;k++)
  102. cout<<"X";
  103. cout<<endl;
  104. }
  105. return 0;
  106. }
  107.  
  108. KWADRAT PUSTY W SRODKU
  109.  
  110.  
  111.  
  112. #include <iostream>
  113.  
  114. using namespace std;
  115.  
  116. int wysokosc,szerokosc;
  117.  
  118. int main()
  119. {
  120. cout<<"Podaj szerokosc prostokata:"; cin>>szerokosc;
  121. cout<<"Podaj szerokosc wysokosc:"; cin>>wysokosc;
  122.  
  123. for(int i=1;i<=szerokosc;i++)
  124. {
  125. cout<<"X";
  126. }
  127. cout<<endl;
  128.  
  129. for(int i=1;i<=wysokosc-2;i++)
  130. {
  131. cout<<"X";
  132. for(int a=1;a<=szerokosc-2;a++)
  133. {
  134. cout<<" ";
  135. }
  136. cout<<"X";
  137. cout<<endl;
  138. }
  139. for(int i=1;i<=szerokosc;i++)
  140. {
  141. cout<<"X";
  142. }
  143.  
  144. return 0;
  145. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement