Guest User

Untitled

a guest
Apr 26th, 2018
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.01 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.     int a,b,c,d,e,f;
  8.     d=0;
  9.     e=0;
  10.     f=0;
  11.     float ter;
  12.     float atfog;
  13.     float beirh;
  14.     float koreirh;
  15.     float kerulet;
  16.     float s;
  17.     cin >> a;
  18.     cin >> b;
  19.     cin >> c;
  20.  
  21.     if (a>b and a>c)
  22.     {
  23.         d=a;
  24.     }
  25.     else
  26.     {
  27.         if (a>b or a>c)
  28.         {
  29.             e=a;
  30.         }
  31.         else
  32.         {
  33.             if (a<b and a<c)
  34.             {
  35.                 f=a;
  36.             }
  37.         }
  38.     }
  39.  
  40.         if (b>a and b>c)
  41.     {
  42.         d=b;
  43.     }
  44.     else
  45.     {
  46.         if (b>a or b>c)
  47.         {
  48.             e=b;
  49.         }
  50.         else
  51.         {
  52.             if (b<a and b<c)
  53.             {
  54.                 f=b;
  55.             }
  56.         }
  57.     }
  58.  
  59.         if (c>b and c>a)
  60.     {
  61.         d=c;
  62.     }
  63.     else
  64.     {
  65.         if (c>b or c>a)
  66.         {
  67.             e=c;
  68.         }
  69.         else
  70.         {
  71.             if (c<b and c<a)
  72.             {
  73.                 f=c;
  74.             }
  75.         }
  76.     }
  77. cout <<" A=" << a << "\n" <<" B=" << b << "\n" <<" C=" << c << "\n";
  78.  
  79. cout << "A legnagyobb: " << d << "\n";
  80. cout << "A masodik: " << e << "\n";
  81. cout << "A harmadik: " << f << "\n";
  82.  
  83.  
  84.     if (d<(e+f) or e<(d+f) or f<(d+e))
  85.     {
  86.         cout << "Ez egy haromszog!" <<"\n";
  87.         if (e*e+f*f==d*d)
  88.         {
  89.             cout << "Ez egy derekszogu haromszog! " << "\n";
  90.             kerulet=d+e+f;
  91.             cout << "Kerulet: " << kerulet << "\n";
  92.             ter=(e*f)/2;
  93.             cout << "Terulet: " << ter <<"\n";
  94.             atfog=(2*ter)/7;
  95.             cout << "Magassag: " << atfog << "\n";
  96.             s=(d+e+f)/2;
  97.             beirh=ter/s;
  98.             cout << "Beirhato kor sugara: " << beirh << "\n";
  99.             koreirh=d/2;
  100.             cout << "Koreirhato kor sugara: " << koreirh << "\n";
  101.  
  102.         }
  103.         else cout << " Ez nem egy derekszogu haromszog! " << "\n";
  104.     }
  105.     else
  106.     {
  107.         cout <<" Ez nem lehet egy haromszog!";
  108.     }
  109.  
  110. return 0;
  111. }
Add Comment
Please, Sign In to add comment