当前位置: 首页 > 工具软件 > Jane > 使用案例 >

zoj 1110 Dick and Jane

危砚
2023-12-01
//2605539 	2011-07-29 19:58:34 	Accepted 	    1110 	C 	0 	160 	ylwh!
//2605535 	2011-07-29 19:56:29 	Wrong Answer 	1110 	C 	0 	160 	ylwh!
//2605534 	2011-07-29 19:55:08 	Wrong Answer 	1110 	C 	0 	160 	ylwh!
#include <stdio.h>
int main(void)
{
	int j, a, b, c, s, p, y;
	while(scanf("%d%d%d%d", &s, &p, &y, &j) != EOF)
	{
		for(a=12+j-1; a>=s+p; a--)
			for(b=p; b<=12+j-a; b++)
			{
				c = 12+j-b-a;
				if(  
					 ( a == b+s || a == b+s+1 ) &&
					 ( b == c+p || b == c+p+1 ) &&//我勒个去,竟然把b==c+p+1写成c==c+p+1,给我块板砖让我自行了断吧 
					 ( a == y+c || a == y+c+1 )
				  )
				goto X;//好久没写多重循环了,竟然忘了break只能跳出一重循环 
			}
		X:
		printf("%d %d %d\n", a, b, c);
	}
    return 0;
}


 类似资料:

相关阅读

相关文章

相关问答