fork(1) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5.  
  6. // your code here
  7. int n = 0;
  8. float a, b, c, temp;
  9.  
  10. scanf("%d", &n);
  11.  
  12. for (int i=0; i<n; i ++) {
  13. scanf("%f %f %f", &a, &b, &c);
  14. if(a>b) temp=a,a=b,b=temp;
  15. if(b>c) temp=b,b=c,c=temp;
  16. if(a>b) temp=a,a=b,b=temp;
  17.  
  18. if (b >= 10)
  19. printf("%.2f\n", (b+c)/2.0);
  20. else
  21. printf("Failed\n");
  22. }
  23.  
  24. return 0;
  25. }
Success #stdin #stdout 0s 4360KB
stdin
2
15.75 18 20
5 15 7.5
stdout
19.00
Failed