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

stdout
******
*OOOO*
*OOOO*
*OOOO*
*OOOO*
******