1.
A.LOW,二目运算符的优先级更大
2.
D.a = b+c=0
0=false
3.
6
自增自减优先级低
4.
x=20 y=30 z=30
x>y =0,z=x不执行
5.
1.score 2.score/10 3.break;
4.9
5.8
6.7
7.6
6.
#include <stdio.h>
int main() {
int year = 0;
scanf("%d",&year);
if( year%400 == 0){
printf("%d年是闰年",year);
}else if(year%4 == 0){
printf("%d年是闰年",year);
}else{
printf("%d年不是闰年",year);
}
return 0;
}
7.
#include <stdio.h>
#include <stdlib.h>
int main()
{
int numA=0, numB=0, numC=0;
scanf("%d %d %d", &numA, &numB, &numC);
int max=0, min=0;
max = numA;
min = numA;
if (max < numB){
max = numB;
}
if (max < numC){
max = numC;
}
if (min > numB){
min = numB;
}
if (min > numC){
min = numC;
}
printf("这三个数中最大值为%d,最小值为%d。\n", max, min);
return 0;
}
8.
#include <stdio.h>
int main()
{
double a, b;
char c;
while (1)
{
scanf("%lf%c%lf", &a, &c, &b);
switch (c)
{
case '+':
printf("%f + %f = %f\n", a, b, a + b);
break;
case '-':
printf("%f - %f = %f\n", a, b, a - b);
break;
case '/':
printf("%f / %f = %f\n", a, b, a / b);
break;
case '*':
printf("%f * %f = %f\n", a, b, a * b);
break;
default:
printf("输入错误\n");
}
}
return 0;
}