Advertisement
Anik_Akash

function - ans-1- circle area

Oct 7th, 2021
698
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.32 KB | None | 0 0
  1. #include<bits/stdc++.h>
  2. using namespace    std;
  3.  
  4. #define flush                    cin.ignore(numeric_limits<streamsize>::max(),'\n')
  5. #define FASTERIO                 ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
  6. #define NL                       cout<<'\n';
  7. #define pi                       acos(-1.0) //3.1415926535897932384626
  8. #define pb                       push_back
  9. #define mk                       make_pair
  10. #define mx                       1000005
  11. #define EPS                      1e-10
  12. #define dpoint(x)                fixed<<setprecision(x)
  13. # define my_sizeof(type) ((char *)(&type+1)-(char*)(&type))
  14. typedef long long int            ll;
  15. typedef double                   dl;
  16. typedef unsigned long long int   ull;
  17.  
  18. dl area_of_circle(int radious){ //dl define as double in above of the code
  19.   dl area = pi*radious*radious;
  20.   return area;
  21. }
  22.  
  23.  
  24. int main() {
  25.  
  26. #ifdef anikakash
  27.     clock_t tStart = clock();
  28.     freopen("input.txt", "r", stdin);
  29.     freopen("tmp.txt", "w", stdout);
  30. #endif
  31.  
  32.     FASTERIO; //cmt when use scanf & printf ;
  33.  
  34.     int radious;
  35.     cin>>radious;
  36.     dl area = area_of_circle(radious);
  37.     cout<<"area of the circle is : "<<area<<endl;
  38.  
  39. #ifdef anikakash
  40.     fprintf(stderr, "\n>> Runtime: %.10fs\n", (double) (clock() - tStart) / CLOCKS_PER_SEC);
  41. #endif
  42.  
  43.     return 0;
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement