Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <iomanip>
- using namespace std;
- int main()
- {
- long double r, l1, l2, pal=100, rez;
- double pi=3.14159292035, constant=37.7;
- double PI=355/113;
- cin>>r;
- if(r<1000000000000000)
- {
- //2*pi*(r+h) - 2*pi*r = 100, => h = 50/pi
- l1=2*PI*r;
- l2=2*PI*(r+pal);
- rez=(l2-l1)/constant;
- cout<<fixed<<setprecision(3)<<rez<<endl;
- }
- else if(r>=1000000000000000)
- {
- // 50/pi => 15.915
- cout<<"15.915\n";
- }
- return 0;
- }
Add Comment
Please, Sign In to add comment