|
|
back to boardwa 8 Posted by garra 9 Jun 2012 11:06 #include<stdio.h> #include<stdlib.h> int main() { int a[8],i,q1=0,q2=1,q3=2,q4=3,r1=4,r2=5,r3=6; for(i=0;i<7;i++) { scanf("%d",&a[i]); } if((a[q2]+a[q3]+a[q4])%2==a[r1]&&(a[q1]+a[q3]+a[q4])%2==a[r2]&&(a[q1]+a[q2]+a[q4])%2==a[r3]) { for(i=0;i<7;i++) { printf("%d",a[i]); printf(" "); } } else if ((a[q2]+a[q3]+a[q4])%2!=a[r1]&&(a[q1]+a[q3]+a[q4])%2!=a[r2]&&(a[q1]+a[q2]+a[q4])%2==a[r3]) { if(a[q3]==1) { a[q3]=0; } else { a[q3]=1; } for(i=0;i<7;i++) { printf("%d",a[i]); printf(" "); } } else if((a[q2]+a[q3]+a[q4])%2!=a[r1]&&(a[q1]+a[q3]+a[q4])%2==a[r2]&&(a[q1]+a[q2]+a[q4])%2!=a[r3]) { if(a[q2]==1) { a[q2]=0; } else { a[q2]=1; } for(i=0;i<7;i++) { printf("%d",a[i]); printf(" "); } } else if((a[q2]+a[q3]+a[q4])%2==a[r1]&&(a[q1]+a[q3]+a[q4])%2!=a[r2]&&(a[q1]+a[q2]+a[q4])%2!=a[r3]) { if(a[q1]==0) { a[q1]=1; } else { a[q1]=0; } for(i=0;i<7;i++) { printf("%d",a[i]); printf(" "); } } else { if(a[q4]==1) { a[q4]=0; } else { a[q4]=1; } for(i=0;i<7;i++) { printf("%d",a[i]); printf(" "); } } return 0; } Re: wa 8 Posted by Noob 9 Jun 2012 13:19 OH SHI~ |
|
|