#2575: OLE??

#### guest

School : Not Student
ID : 3
IP address : [180.217.140.206]
2017-09-10 12:45:22
d511. 小明的作業 -- | From: [125.231.98.88] | Post Date : 2009-10-31 16:06

//================================= MY CODE:

#include <stdio.h>

int main () {
int a, b, c, tmp;
int T = 5, ans;
while (scanf("%d%d%d", &a, &b, &c) != EOF) {
//---------------------1
ans = 0;
if (a > b) {
tmp = b; b = a; a = tmp;
}
if (b > c) {
tmp = c; c = b; b = tmp;
}
if ((a + b) > c) {
ans++;
}
//--------------------2
scanf("%d%d%d", &a, &b, &c);
if (a > b) {
tmp = b; b = a; a = tmp;
}
if (b > c) {
tmp = c; c = b; b = tmp;
}
if ((a + b) > c) {
ans++;
}
//---------------------3
scanf("%d%d%d", &a, &b, &c);
if (a > b) {
tmp = b; b = a; a = tmp;
}
if (b > c) {
tmp = c; c = b; b = tmp;
}
if ((a + b) > c) {
ans++;
}
//---------------------4
scanf("%d%d%d", &a, &b, &c);
if (a > b) {
tmp = b; b = a; a = tmp;
}
if (b > c) {
tmp = c; c = b; b = tmp;
}
if ((a + b) > c) {
ans++;
}
//--------------------5
scanf("%d%d%d", &a, &b, &c);
if (a > b) {
tmp = b; b = a; a = tmp;
}
if (b > c) {
tmp = c; c = b; b = tmp;
}
if ((a + b) > c) {
ans++;
}
printf("%d\n", ans);
}
return 0;
}

ZeroJudge Forum