Advertisement
Guest User

Untitled

a guest
Feb 18th, 2018
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. #include <iostream>
  2. #include <windows.h>
  3.  
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8. int n;
  9. cout <<"Liczba n:";
  10. cin >> n;
  11.  
  12.  
  13.  
  14. for (int rows=0; rows!=n;rows++)
  15. {
  16. Sleep(200);
  17.  
  18. for (int cols=0; cols!=n; cols++)
  19. {
  20. if (rows==0 || rows==n-1 || cols==0 || cols==n-1)
  21. {
  22. cout <<"*";
  23.  
  24. }
  25. else
  26. {
  27. cout <<" ";
  28.  
  29. }
  30.  
  31.  
  32. }
  33. cout << endl;
  34. }
  35.  
  36.  
  37.  
  38. /* Rysowanie trójkąta:
  39.  
  40. for (int i=0; i<n; i++)
  41. {
  42. //1. Puste pola
  43. for (int j=0; j<n-i; j++)
  44. {
  45. cout <<" ";
  46. }
  47. for (int k=0; k<2*i-1; k++)
  48. {
  49. cout <<"*";
  50. }
  51. cout << endl;
  52. }
  53. */
  54.  
  55.  
  56. return 0;
  57. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement