fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6. int num1;
  7.  
  8. cout << "please enter a size between 1-9: ";
  9. cin >> num1;
  10.  
  11. cout << endl;
  12.  
  13. for(int i = 0; i < num1; ++i)
  14. {
  15. for(int j = 0; j < num1; ++j)
  16. {
  17. if (j == i)
  18. cout << num1;
  19. else
  20. cout << "*";
  21. }
  22.  
  23. cout << "\n";
  24. }
  25.  
  26. return 0;
  27. }
Success #stdin #stdout 0s 15232KB
stdin
6
stdout
please enter a size between 1-9: 
6*****
*6****
**6***
***6**
****6*
*****6