标签:
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 581 Accepted Submission(s): 201
1 #include <stdio.h> 2 #include<algorithm> 3 using namespace std; 4 int main() 5 { 6 int a[4]; 7 while(scanf("%d%d%d",&a[1],&a[2],&a[3])!=EOF) 8 { 9 sort(a+1,a+4);//保证从小到大排序! 10 if(a[2]==a[1]||(a[2]-a[1])%3==0) 11 printf("%d\n",a[2]); 12 else if(a[2]==a[3]||a[1]==a[3]||(a[3]-a[2])%3==0||(a[3]-a[1])%3==0) 13 printf("%d\n",a[3]); 14 else 15 printf("):\n"); 16 } 17 return 0; 18 }
标签:
原文地址:http://www.cnblogs.com/Eric-keke/p/4680455.html