#29506: help

#### a0955077720@gmail.com (陳丹尼)

School : No School
ID : 171273
2022-07-09 21:03:18
h026. 202001_1 猜拳 -- | From: [123.192.133.48] | Post Date : 2022-03-08 00:35

大神幫幫忙看不出錯在哪#include<bits/stdc++.h>
using namespace std;
int main(void)
{
ios::sync_with_stdio(0);
cin.tie(0);
int count=0;
int b,n;
cin>>b>>n;
int s[n];
for(int i=1;i<=n;i++){
cin>>s[i];
}

for(int i=1;i<=n;i++){
if(b==0){//stone
if(s[i]==2){//scissor
cout<<b<<" : Won at round "<<i<<"\n";
count=0;
break;
}
if(s[i]==5){//paper
cout<<b<<" : Lost at round "<<i<<"\n";
count=0;
break;
}
if(s[i]==0){
cout<<b<<" ";
count++;
if(count==n){
cout<<": Drew at round "<<i<<"\n";
count=0;
break;
}else if(count%2==0){
b=5;
}else if(count%2!=0){
b=0;
}
}
}
if(b==2){//scissor
if(s[i]==5){//paper
cout<<b<<" : Won at round "<<i<<"\n";
count=0;
break;
}
if(s[i]==0){//stone
cout<<b<<" : Lost at round "<<i<<"\n";
count=0;
break;
}
if(s[i]==2){
cout<<b<<" ";
count++;
if(count==n){
cout<<": Drew at round "<<i<<"\n";
count=0;
break;
}else if(count%2==0){
b=0;
}else if(count%2!=0){
b=2;
}
}
}
if(b==5){//paper
if(s[i]==0){//stone
cout<<b<<" : Won at round "<<i<<"\n";\
count=0;
break;
}
if(s[i]==2){//scissor
cout<<b<<" : Lost at round "<<i<<"\n";
count=0;
break;
}
if(s[i]==5){
cout<<b<<" ";
count++;
if(count==n){
cout<<": Drew at round "<<i<<"\n";
count=0;
break;
}else if(count%2==0){
b=2;
}else if(count%2!=0){
b=5;
}
}
}
}
return 0;
}

#29519: Re:help

#### cges30901 (cges30901)

School : No School
ID : 30877
2022-08-14 16:16:23
h026. 202001_1 猜拳 -- | From: [27.247.9.93] | Post Date : 2022-03-08 19:01

		if(b==2){//scissor

if(b==5){//paper


if改成else if

#29522: Re:help

#### a0955077720@gmail.com (陳丹尼)

School : No School
ID : 171273
2022-07-09 21:03:18
h026. 202001_1 猜拳 -- | From: [223.136.111.126] | Post Date : 2022-03-08 22:28

		if(b==2){//scissor

if(b==5){//paper


if改成else if

ZeroJudge Forum