WA了
查看原帖
WA了
1412103
kevin0574楼主2024/12/1 13:14

有大佬知道为什么只有四分吗 回复必关

#include<iostream>
using namespace std;
int n;
void zhong(int x){
	for(int i = 1;i <= x;i++){
		if(i == 1 || i == x){
			cout << '|';
		}else{
			cout << '-';
		}
	}	
}
void pin(int x){
	for(int i = 1;i <= x;i++){
		if(i == 1 || i == x){
			cout << '|';
		}else{
			cout << 'x';
		}
	}	
}
int main(){
	cin >> n;
	for(int j = 1;j <= n;j++){
		if(j%2==0){
			pin(n);
		}else{
			zhong(n);
		}
		cout << endl;
	}
	return 0;
}
2024/12/1 13:14
加载中...