fork download
  1. //Bai 6
  2.  
  3. #include<bits/stdc++.h>
  4. using namespace std;
  5. #define el "\n"
  6. #define ll long long
  7. #define ull unsigned long long
  8. #define se second
  9. #define fi first
  10. #define be begin()
  11. #define en end()
  12. #define Faster cin.tie(0); cout.tie(0); ios_base::sync_with_stdio(0);
  13.  
  14. void Run(int n)
  15. {
  16. cin >> n;
  17. for(int i = 1; i < 2 * n; i++)
  18. {
  19. if(i <= n)
  20. {
  21. for(int j = 1; j < 2 * i; j++) cout << "*";
  22. }
  23. else
  24. {
  25. for(int j = 1; j < 2 * (2 * n - i); j++) cout << "*";
  26. }
  27. cout << el;
  28. }
  29. }
  30. int main()
  31. {
  32. Faster;
  33. int n;
  34. Run(n);
  35. return 0;
  36. }
  37.  
  38.  
Success #stdin #stdout 0s 5280KB
stdin
Standard input is empty
stdout
Standard output is empty