#include <iostream>
using namespace std;

void setThreshold (int x){
    cout << "Threshold set to " << x ;
}

void setThreshold (double x){
    cout << "Threshold set to " << x ;
}

int main() {
   double val;
   cin >> val;
   if (val == (int)val) {
       setThreshold((int)val); // int version
   } else {
       setThreshold(val);      // double version
   }
   return 0;
}

same as prev

 

 

 

 

Upvote
Downvote
Loading...

Input

50

Expected Output

Threshold set to 50