参考答案(别举报我)
查看原帖
参考答案(别举报我)
1386326
Clovtong楼主2025/1/10 20:14

仅供参考,举报我全家四

#include <bits/stdc++.h>
using namespace std;
int n;
int main()
{
	cin>>n;
	for (int i = 1; i <= n; i++) 
	{
	    for (int j = 1; j <= n; j++) 
		{
	        if ( j==1 || j==i || j==n )
	            cout << '+';
	        else
	            cout << '-';
	    }
		cout << endl;
	}
	return 0;
}
2025/1/10 20:14
加载中...