Problem: 2780 - Robot Basketball
Solution:
#include<bits/stdc++.h>
using namespace std;
int fun(int m);
int result = 0;
int main()
{
int n;
cin>>n;
cout<<fun(n)<<endl;
return 0;
}
int fun(int m){
if(m<=800 && m>=0)
{
result=result+1;
}
else if(m>800 && m<=1400)
{
result=result+2;
}
else if(m>1400 && m<=2000)
{
result=result+3;
}
return result;
}
Maruf
No comments yet. Be the first to comment!