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