rengetsu

ProcedurProgramavimas_2.19

Apr 5th, 2018
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.54 KB | None | 0 0
  1. #include <iostream>
  2. #include <iomanip>
  3. using namespace std;
  4. int main()
  5. {
  6. long double r, l1, l2, pal=100, rez;
  7. double pi=3.14159292035, constant=37.7;
  8. double PI=355/113;
  9.    
  10. cin>>r;
  11.     if(r<1000000000000000)
  12.     {
  13.         //2*pi*(r+h) - 2*pi*r = 100, =>  h = 50/pi
  14.         l1=2*PI*r;
  15.         l2=2*PI*(r+pal);
  16.        
  17.         rez=(l2-l1)/constant;
  18.        
  19.         cout<<fixed<<setprecision(3)<<rez<<endl;
  20.     }
  21.     else if(r>=1000000000000000)
  22.     {
  23.         // 50/pi => 15.915
  24.         cout<<"15.915\n";
  25.     }
  26. return 0;
  27. }
Add Comment
Please, Sign In to add comment