fork download
  1. #include <iostream>
  2. #include <string>
  3. #include <cstdlib>
  4.  
  5. using namespace std;
  6. int q=0;
  7. int t;
  8. long double a, b, c;
  9.  
  10. int main()
  11. {
  12. cin>>t;
  13. while(q<t)
  14. {
  15. string liczba1, liczba2, liczba3;
  16. cin>>liczba1>>liczba2>>liczba3;
  17.  
  18. size_t pos1 = liczba1.find("/");
  19. size_t pos2 = liczba2.find("/");
  20. size_t pos3 = liczba3.find("/");
  21.  
  22. string first1 = liczba1.substr (0,pos1);
  23. string first2 = liczba1.substr (pos1+1);
  24.  
  25. string second1 = liczba2.substr (0,pos2);
  26. string second2 = liczba2.substr (pos2+1);
  27.  
  28. string third1 = liczba3.substr (0,pos3);
  29. string third2 = liczba3.substr (pos3+1);
  30.  
  31. long double i = atof(first1.c_str());
  32. long double j = atof(first2.c_str());
  33.  
  34. long double k = atof(second1.c_str());
  35. long double l = atof(second2.c_str());
  36.  
  37. long double m = atof(third1.c_str());
  38. long double n = atof(third2.c_str());
  39. a=i/j;
  40. b=k/l;
  41. c=m/n;
  42. if(a>=b && a>=c)
  43. {
  44. if(a<(b+c))
  45. cout<<"TAK"<<endl;
  46. else
  47. cout<<"NIE"<<endl;
  48. }
  49. else if(b>=a && b>=c)
  50. {
  51. if(b<(a+c))
  52. cout<<"TAK"<<endl;
  53. else
  54. cout<<"NIE"<<endl;
  55. }
  56. else if(c>=a && c>=b)
  57. {
  58. if(c<(b+a))
  59. cout<<"TAK"<<endl;
  60. else
  61. cout<<"NIE"<<endl;
  62. }
  63. else
  64. cout<<"NIE"<<endl;
  65. q++;
  66. }
  67. return 0;
  68. }
  69.  
  70.  
Success #stdin #stdout 0s 3416KB
stdin
Standard input is empty
stdout
Standard output is empty