fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. // your code goes here
  6. for(int i =0;i<5;i++){
  7. for(int j =0;j<5-i-1;j++){
  8. cout<<" ";
  9. }
  10. for(int j =0;j<=i;j++){
  11. cout<<"*";
  12. }
  13. cout<<endl;
  14. }
  15. return 0;
  16. }
Success #stdin #stdout 0s 5320KB
stdin
Standard input is empty
stdout
    *
   **
  ***
 ****
*****