F to c conversion

#include
using namespace std;

int main() {
int f1,f2,f3;
cin>>f1>>f2>>f3;
int max=(f1>f2)?((f1>f3)?f1:f3):((f2>f3)?f2:f3);
int min=(f1<f2)?((f1<f3)?f1:f3):((f2<f3)?f2:f3);

for(int F=min;F<=max;F+=20)
{
    int C=(5*(F-32))/9;
    cout<<F<<" "<<C<<endl;
}
return 0;

}
my program is correct but why i fail on last test case??
and also in editorial the program written in java .why??

hey @guptaaman155, your logic is not correct, f1 and f2 are itself max and min. No need to calulate max and min separately. Moreover loop variable should be increment with f3 not 20. I have made changes to your code, you can check them here https://ide.codingblocks.com/s/101636

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.