2 条题解

  • 4
    @ 2025-1-16 15:18:09
    #include<iostream>
    using namespace std;
    int main(){
    	int n;
    	cin >> n;
    	for (int i = 1; i <= n; i++)
    		cout << "*";
    	cout << endl;
    	for (int j = 1; j <= n; j++){
    		cout << "*";
    		for (int p = 1; p <= n - 2; p++)
    			cout << " ";
    		cout << "*";
    		cout << endl;
    	}
    	for (int i = 1; i <= n; i++)
    		cout << "*";
    	return 0;
    } 
    
    • 1
      @ 2025-6-9 20:52:03
      #include<iostream>
      using namespace std;
      int main(){
      	int n;
      	cin >> n;
      	for (int i = 1; i <= n; i++)
      		cout << "*";
      	cout << endl;
      	for (int j = 1; j <= n; j++){
      		cout << "*";
      		for (int p = 1; p <= n - 2; p++)
      			cout << " ";
      		cout << "*";
      		cout << endl;
      	}
      	for (int i = 1; i <= n; i++)
      		cout << "*";
      	return 0;
      } 
      
      
      • 1

      信息

      ID
      45
      时间
      1000ms
      内存
      256MiB
      难度
      4
      标签
      递交数
      218
      已通过
      106
      上传者