fork download
  1. #include <bits/stdc++.h>
  2.  
  3. using namespace std;
  4.  
  5. int main() {
  6. int t, s, h;
  7. cin >> t >> s >> h;
  8. for(int i = 0; i < t; i++){
  9. for(int k = 0; k < 3; k++){
  10. cout << '*';
  11. for(int j = 0; j < s; j++){
  12. cout << ' ';
  13. }
  14. }
  15. cout << endl;
  16. }
  17.  
  18. for(int i = 0; i < 3 + 2*s; i++){
  19. cout << '*';
  20. }
  21. cout << endl;
  22. for(int j = 0; j < h; j++){
  23. for(int i = 0; i < s+1; i++){
  24. cout << ' ';
  25. }
  26. cout << '*';
  27. for(int i = 0; i < s+1; i++){//shouldn't need this?
  28. cout << ' ';
  29. }
  30. cout << endl;
  31. }
  32. return 0;
  33. }
Success #stdin #stdout 0s 15240KB
stdin
4
3
2
stdout
*   *   *   
*   *   *   
*   *   *   
*   *   *   
*********
    *    
    *