|
|
вернуться в форум#WA8 Strange. Can you give me some test data for my C++ program? if ((sir[0]==sir1[1] && sir[1]==sir1[0] && sir[2]+sir[3]==sir1[2]+sir1[3]) || ((sir[3]==sir1[1] && sir[2]==sir1[0]) && (sir[0]==sir1[2] && sir[1]==sir1[3]))) cout <<"equal"; else { if (sir[0]==sir1[2] && sir[1]==sir1[3] && sir[3]==sir1[1] && sir[2]==sir1[0] ) cout <<"equal"; else { if (sir[0]==sir1[1] && sir[1]==sir1[3] && sir[2]==sir1[2] && sir[3]==sir1[0]) cout <<"equal"; else { if (sir[0]==sir1[0] && sir[1]==sir1[1] && sir[2]==sir1[2] && sir[3]==sir1[3]) cout <<"equal"; else { if (sir[3]==sir1[0]&&sir[2]==sir1[1]&&sir[1]==sir1[2]&&sir[0]==sir1[3]) cout <<"equal";
else cout <<"different"; } } } } My code seems legit. Tnx. All tests posted on the Forum (Discuss work for my program) Again working. Edited by author 15.03.2012 17:12 Edited by author 15.03.2012 17:24 Re: #WA8 Послано Morph 15 мар 2012 16:47 GRBY YGBR should be equal. Re: #WA8 Послано Morph 15 мар 2012 16:54 Here: sir[2]==sir1[3] && sir[3]==sir1[2] YGBR GBRY should be different. :D Re: #WA8 Послано Morph 15 мар 2012 17:07 sir[0]==sir1[1] && sir[1]==sir1[0] RRRR RRGG your algorithm's output is equal. :) Re: #WA8 Послано Morph 15 мар 2012 17:21 (sir[3]=sir1[0]&&sir[2]=sir1[1]&&sir[1]=sir1[2]&&sir[0]=sir1[3]) - is equal Try it: RGBY YBGR I'm not sure it's right, but you can try. :) |
|
|