NYOJ659 判断三角形

原题链接

注意1, 1, 3的情况。

#include <stdio.h>

int main(){
	int i = 1, a, b, c, count, t;
	scanf("%d", &t);
	while(t--){
		scanf("%d%d%d", &a, &b, &c);
		count = 0;
		if(a + b > c && a - b < c && b - a < c)
			++count;
		if(a == b || a == c || b == c)
			if(count) ++count;
		if(a == b && a == c)
			if(count) ++count;
		printf("Case #%d:\n", i++);
		if(!count) printf("NO");
		else while(count--)
			printf("YE ");
		printf("\n");		
	}
	return 0;
}


posted on 2014-03-07 19:38  长木Qiu  阅读(144)  评论(0编辑  收藏  举报