有一个函数
{x x<1
y = | 2x-1 1<=x<10
|3x-11 x>=10}
写一段程序,输入x,输出y
输入一个数x
输出一个数.
#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;
}