【分支语句—嵌套】分段函数
#include <iostream>
using namespace std;
int main()
{
float x,y;
cin>>x;
if(x<1)
y=x;
else
{
if(x<10)
y=x+5;
else
y=x-5;
}
cout<<y;
return 0;
}