不是哥们,在devc++里是对的呀?
查看原帖
不是哥们,在devc++里是对的呀?
1598886
fangchengx楼主2024/12/4 21:17
#include <bits/stdc++.h>
using namespace std;
int main()
{
	int n,i,j;
	cin>>n;
	for(i=1;i<=n;i++){
		for(j=1;j<=n;j++){
			if(j==1){
				cout<<"|";
			}
		}
		for(j=1;j<=n/2+1;j++){
			if(i==n/2+1){
				cout<<"-";
			}
			else{
				cout<<"a";
			}
		}
		for(j=1;j<=n;j++){
			if(j==n){
				cout<<"|";
			}
		}
		cout<<endl;
	}
}
2024/12/4 21:17
加载中...