#include<iostream>
#include<stdio.h>
using namespace std;
int main()
{
float x,y;
cin>>x;
if(0<=x&&x<5)
{
y=-x+2.5;
}
else if(5<=x&&x<10)
{
y=2-1.5*(x-3)*(x-3);
}
else
{
y=x/2-1.5;
}
printf("%.3f",y);
return 0;
}
信息学奥赛一本通1051
最新推荐文章于 2024-07-25 18:43:45 发布