fork download
  1. /* Author : Nguyen Thanh Tung - Tran Hung Dao High School for Gifted Student */
  2.  
  3. #include <bits/stdc++.h>
  4.  
  5. using namespace std;
  6.  
  7. #define endl '\n'
  8. #define ft first
  9. #define sc second
  10. #define ll long long
  11. #define vll vector<ll>
  12. #define vp vector<pll>
  13. #define pll pair<ll, ll>
  14. #define ull unsigned long long
  15. #define FOR(i, l, r) for (ll i = (l); i <= (r); ++i)
  16. #define FORD(i, r, l) for (ll i = (r); i >= (l); --i)
  17.  
  18. const long long maxn = 1e6 + 9;
  19. const long long N = 3e4 + 9;
  20. const long long oo = 1e18 + 9;
  21. const long long INF = 0x3f;
  22. const long long MOD = 1e9 + 7;
  23.  
  24. #define TASK "code"
  25.  
  26. ll tinh(ll x1, ll y1, ll x2, ll y2)
  27. {
  28. return (x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1);
  29. }
  30.  
  31. void solve()
  32. {
  33. ll x1, x2, x3, y1, y2, y3;
  34. cin >> x1 >> y1;
  35. cin >> x2 >> y2;
  36. cin >> x3 >> y3;
  37. ll AB2 = tinh(x1, y1, x2, y2);
  38. ll AC2 = tinh(x1, y1, x3, y3);
  39. ll BC2 = tinh(x2, y2, x3, y3);
  40. if (sqrt(AB2) + sqrt(AC2) <= sqrt(BC2) || sqrt(AB2) + sqrt(BC2) <= sqrt(AC2) || sqrt(AC2) + sqrt(BC2) <= sqrt(AB2))
  41. {
  42. cout << "khong la tam giac";
  43. }
  44. else if (AB2 + BC2 == AC2 || AB2 + AC2 == BC2 || AC2 + BC2 == AB2)
  45. {
  46. cout << "vuong";
  47. }
  48. else if (AB2 == AC2 || AB2 == BC2 || AC2 == BC2)
  49. {
  50. cout << "can";
  51. }
  52. }
  53.  
  54. int main()
  55. {
  56. ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  57. // freopen(TASK ".inp", "r", stdin);
  58. // freopen(TASK ".out", "w", stdout);
  59. solve();
  60. return 0;
  61. }
  62. /// Stay calm, read the question slowly and understand the question, it is often simpler than you imagine
  63.  
Success #stdin #stdout 0s 5320KB
stdin
Standard input is empty
stdout
Standard output is empty