answer for mac
#include<stdio.h>
int main()
{
float x;
while(scanf("%f",&x)!=EOF)
{
if(x<1)
{
printf("y=%.2f",x);
}
else if(1<=x && x<10)
{
printf("y=%.2f",2*x-1);
}
else if(x>=10)
{
printf("y=%.2f",3*x-11);
}
}
}
normal answer
answer for win
#include<stdio.h>
int main()
{
float x;
scanf("%f",&x);
if(x<1)
{
printf("y=%.2f",x);
}
else if(1<=x && x<10)
{
printf("y=%.2f",2*x-1);
}
else if(x>=10)
{
printf("y=%.2f",3*x-11);
}
}