Advertisement
Vl4d_Cr15714n

Untitled

Feb 17th, 2020
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.18 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3. int main()
  4. {
  5. int n,l,c;
  6. cin>>n;
  7. for(l=1; l<=n; l++)
  8. {
  9. for(c=1; c<=l; c++)
  10. {
  11. cout<<'*';
  12. }
  13. for(c=1; c<=3*n-2*l; c++)
  14. {
  15. cout<<' ';
  16. }
  17. for(c=1; c<=l; c++)
  18. {
  19. cout<<'*';
  20. }
  21. cout<<'\n';
  22. }
  23. for(l=1; l<=n; l++)
  24. {
  25. while(l<=n)
  26. {
  27. for(c=1; c<=n; c++)
  28. {
  29. cout<<' ';
  30. }
  31. for(c=1; c<=n; c++)
  32. {
  33. cout<<'*';
  34. }
  35. cout<<'\n';
  36. l++;
  37. }
  38. for(l=1; l<=n; l++)
  39. {
  40. for(c=1; c<=n+1-l; c++)
  41. {
  42. cout<<'*';
  43. }
  44. for(c=n+1-l; c<n; c++)
  45. {
  46. cout<<' ';
  47. }
  48. for(c=1; c<=n; c++)
  49. {
  50. cout<<' ';
  51. }
  52. for(c=1; c<l; c++)
  53. {
  54. cout<<' ';
  55. }
  56. for(c=l; c<=n; c++)
  57. {
  58. cout<<'*';
  59. }
  60. cout<<'\n';
  61. }
  62. }
  63. return 0;
  64. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement