嵌入式
- 1、 已知三个数a,b,c,找出最大值放于max中。
- 2、输入某学生的成绩,经处理后给出学生的等级,等级分类如下:
- 3、有一函数:
- 4、输入字母,把小写字母转换为大写字母。
- 5、判断是否是闰年。(能被4整除,但不能被100整除或能被400整除)
- 6.求5!
- 7打印出所有的“水仙花”数。“水仙花”数是指一个3位数,其各个位数字立方和等于该数本身。 (例如:153 == 1 *1 *1 + 5*5*5 + 3*3*3)
- 8、编写一个程序打印出下列图形:
- 9、打印出9*9乘法表。(直角三角模型)
- 11、求和s=1!+2!+3!+4!
- 12、使用嵌套循环产生下列图案,要求用for嵌套循环。
- 13、判断101-500之间有多少个素数,并输出所有素数,除了1和它本身以外不再有其他的因数。
1、 已知三个数a,b,c,找出最大值放于max中。
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <strings.h>
int main(){
int a, b, c, max;
max = a;
scanf("%d,%d,%d",&a,&b,&c);
if(a>b){
if(a>c){
max = a;
}else{
max = c;
}
}else if(a<b){
if(b>c){
max = b;
}else{
max = c;
}
}
printf(“max=%d”,max);
puts("");
return 0;
}
2、输入某学生的成绩,经处理后给出学生的等级,等级分类如下:
90分以上(包括90): A
80至90分(包括80):B
70至80分(包括70):C
60至70分(包括60):D
60分以下:E
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <strings.h>
int main(){
int i;
printf(“请输入学生成绩:(满分100!)”);
scanf("%d",&i);
int n = i/10;
if(i>=0&&i<=100){
switch(n){
case 10:
printf(“A”);//
break; //可以不要
case 9:
printf(“A”);
break;
case 8:
printf(“B”);
break;
case 7:
printf(“C”);
break;
case 6:
printf(“D”);
break;
default:
printf(“E”);
}
}else{
printf(“error!!!”);
}
puts("");
return 0;
}
3、有一函数:
y= x x<1
2x-1 1=<x<10
3x-11 x>=10
用scanf函数输入x的值(分别为x<1,1~10,>=10三种情况),求y值。
#include