fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. int N;
  6. cin >> N;
  7. int M;
  8. cin >> M;
  9.  
  10. for (int i = 0; i < N; i++) {
  11.  
  12. for (int j = 0; j < i; j++) {
  13. cout << " ";
  14. }
  15.  
  16.  
  17. for (int k = 0; k < M; k++) {
  18. cout << "*";
  19. }
  20.  
  21. cout << endl;
  22. }
  23.  
  24. return 0;
  25. }
Success #stdin #stdout 0.01s 5284KB
stdin
8 5
stdout
*****
 *****
  *****
   *****
    *****
     *****
      *****
       *****