![](https://csdnimg.cn/release/download_crawler_static/87076728/bg6.jpg)
|3x-11| (
)
#include<stdio.h>
#include〈math。h>
main()
{
int x,y;
printf("input x=:”);
scanf(”%d”,&x);
if(x〈1) y=x;
else if(x<10) y=2*x—1;
else y=abs(3*x-11);
printf("x=%d y=%d\n",x,y);
}
4.编写程序,输入一百分制成绩,对应输出等级 A、B、C、D、E,90 分以上为 A,80 分—89 分
为 B,70 分—79 分为 C,60 分—69 分为 D,60 分以下为 E。
方法一:用 if 语句
#include<stdio.h>
main()
{
float score;
char grade;
scanf(”%f”, &score);
if(score〉100||score<0) printf("\ninput error!”);