社区讨论

95分,测试10没过,求调

P13829【MX-X18-T1】「FAOI-R6」520参与者 2已保存回复 11

讨论操作

快速查看讨论及其快照的属性,并进行相关操作。

当前回复
11 条
当前快照
1 份
快照标识符
@mhjd3b84
此快照首次捕获于
2025/11/04 00:35
4 个月前
此快照最后确认于
2025/11/04 06:11
4 个月前
查看原帖
代码
CPP
#include<bits/stdc++.h>
using namespace std;
char a[9][8]={{},{},{' ',' ',' ','/','*','-',' ',' '},{' ',' ','7','8','9','+',' ',' '},{' ',' ','4','5','6','+',' ',' '},{' ',' ','1','2','3',' ',' ',' '},{' ',' ','0','0','.',' ',' ',' '}};
int main(){
	string b;
	cin>>b;
	int stx,sty;
	for(int i=0;i<5;i++){
		for(int j=0;j<4;j++){
			if(a[i][j]==b[0]){
				stx=i;
				sty=j;
			}
		}
	}
	if(a[stx+1][sty]==b[1]&&a[stx+2][sty]==b[2]){
		cout<<"Yes";
		return 0;
	}
	if(a[stx-1][sty]==b[1]&&a[stx-2][sty]==b[2]){
		cout<<"Yes";
		return 0;
	}
	if(a[stx][sty+1]==b[1]&&a[stx][sty+2]==b[2]){
		cout<<"Yes";
		return 0;
	}
	if(a[stx][sty-1]==b[1]&&a[stx][sty-2]==b[2]){
		cout<<"Yes";
		return 0;
	}
	cout<<"No";
	return 0;
} 

回复

11 条回复,欢迎继续交流。

正在加载回复...