Ahmed_Negm

Untitled

Dec 7th, 2021
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.55 KB | None | 0 0
  1. #include<iostream>
  2. #include<iomanip>
  3. #include<cmath>
  4. #include <algorithm>
  5. using namespace std;
  6. void Ahmed_Negm(){
  7.   #ifndef ONLINE_JUDGE  
  8.     freopen("input.txt", "r", stdin), freopen("output.txt", "w", stdout);
  9.   #endif
  10. }
  11. int main()
  12. {Ahmed_Negm();
  13.  
  14.  
  15. double num1, num2, num3;
  16. cin>>num1>>num2>>num3;
  17. double res = (num1 * num2) / num3;
  18. long long nres = res;
  19. double myres = res - nres;
  20.  
  21. if(nres <= 2147483647 && myres == 0){
  22.   cout<<"int";
  23. }else if(myres != 0){
  24.   cout<<"double";
  25. }else{
  26.   cout<<"long long";
  27. }
  28.  
  29.  
  30.  
  31.  
  32.     return 0;
  33. }
Advertisement
Add Comment
Please, Sign In to add comment