C++ :
#include<iostream> using namespace std; int main() { int x,y; cin>>x; if (x<1) y=x; else if (x>=1 && x<=10) y=2*x-1; else y=3*x-11; cout<<y<<endl; return 0; }
By signing up a 算道OJ universal account, you can submit code and join discussions in all online judging services provided by us.
Using your 算道OJ universal account