1.C语言输出如下菜单
2.Cè¯è¨èåç¨åºç¼å
C语言输出如下菜单
大致代码如下#include <stdio.h>#include <stdlib.h>
void menu()
{
printf ("\t 主菜单\n");
printf ("===============================\n");
printf ("\t1.输出学生成绩\n");
printf ("\t2.查询学生成绩\n");
printf ("\t3.打印学生成绩\n");
printf ("\t0.退出系统\n");
printf ("===============================\n");
}
int main()
{
int operation;
menu();
scanf("%d",单源单代中科溯源码和普通溯源码区别 &operation);
switch(operation){
case 1:
printf ("请输入\n");
break;
case 2:
printf ("请输入查询学生学号\n");
break;
case 3:
printf ("正在输出\n");
break;
case 0:
printf ("谢谢使用\n");
break;
default:
printf ("输入错误\n");
break;
}
return 0;
}
Cè¯è¨èåç¨åºç¼å
#include <stdio.h>
#include <math.h>
void armstrong(int a)
{
int i;
int n = 1;
int b = a;
int s = 0;
while(b /= ) n++;
b = a;
for(i = 0; i < n; i ++){
s += (int)pow(b%, n);
b /= ;
}
if(s == a){
printf("%d æ¯æ°´ä»è±æ°!\n", a);
}else{
printf("%d ä¸æ¯æ°´ä»è±æ°!\n", a);
}
}
void prime(int a)
{
int i;
if(a < 2) {
printf("%d ä¸æ¯ç´ æ°!\n", a);
return ;
}
for(i = 2; i < a; i ++){
if(a % i == 0) {
printf("%d ä¸æ¯ç´ æ°!\n", a);
return ;
}
}
printf("%d æ¯ç´ æ°!\n", a);
}
void max(int a, int b, int c)
{
if(b > a) a = b;
if(c > a) a = c;
printf("æ大å¼æ¯ï¼%d\n", a);
}
void factorial(int a)
{
int i;
int f = 1;
for(i = a; i >1; i --)
f *= i;
printf("%d çé¶ä¹æ¯ï¼%d\n", a, f);
}
int main(int argc, char **argv)
{
int a, b, c;
int type ;
int run = 1;
printf("æ¬ç¨åºå¯å®ææäºæ°å¦è®¡ç®:\n");
printf( "
2024-11-30 00:28
2024-11-30 00:28
2024-11-29 23:33
2024-11-29 22:24
2024-11-29 22:19
2024-11-29 22:14