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