摘要:
1.实现一个菜单 可以切换 ,可以返回主菜单 主菜单 1.登录 2.注册 3.输出水仙花数 4.退出程序 请选择: 选择后实现对应的功能 #include<stdio.h> void mainMenu(); void two(); main() { mainMenu(); } void mainMe 阅读全文
posted @ 2021-12-09 10:55
淘气5555
阅读(63)
评论(0)
推荐(0)
摘要:
#include<stdio.h> main() { char a[20]; int i=0,lenth=0; printf("请输入字符"); scanf("%s",a); while(a[i++]!='\0'){ lenth++; } printf("字符串的长度为%d",lenth); } 2 阅读全文
posted @ 2021-12-09 10:54
淘气5555
阅读(82)
评论(0)
推荐(0)
摘要:
#include<stdio.h> main() { int a[8],i; for(i=0;i<8;i++) { scanf("%d",&a[i]); } printf("逆序输出后\n"); for(i=7;i>=0;i--) { printf("%d\n",a[i]); } } 2.使用一维数 阅读全文
posted @ 2021-12-09 10:53
淘气5555
阅读(38)
评论(0)
推荐(0)
摘要:
#include<stdio.h> #include <stdlib.h> #include <time.h> int main() { while(1) { int a=0,b; srand((unsigned)time(NULL)); a = rand()%100+1; printf("请输入一 阅读全文
posted @ 2021-12-09 10:52
淘气5555
阅读(41)
评论(0)
推荐(0)
摘要:
#include <stdio.h> main() { int a,b,n; for(a=1;a<=5;a++) { printf("\n"); for(b=1;b<=a;b++) { printf("*"); } } } #include <stdio.h> main() { int a,b,n; 阅读全文
posted @ 2021-12-09 10:51
淘气5555
阅读(14)
评论(0)
推荐(0)
摘要:
#include <stdio.h> main() { int a=1,b=0; while(a<=21) { if(a%2) b=b+a; a++; } printf("%d",b); } 2.p60 2 #include <stdio.h> main() { int i=1,n; double 阅读全文
posted @ 2021-12-09 10:50
淘气5555
阅读(16)
评论(0)
推荐(0)
摘要:
#include <stdio.h> main() { int n; printf("请输入一个数字"); scanf("%d",&n); if(n>0) printf("这个数字是正数"); else if(n==0) printf("这个数字是0"); else printf("这个数字是负数" 阅读全文
posted @ 2021-12-09 10:48
淘气5555
阅读(25)
评论(0)
推荐(0)
摘要:
#include <stdio.h> main() { int f; printf("请输入学生的分数(0-100):\n"); scanf("%d",&f); switch(f/10) { case 10: case 9:printf("A\n");break; case 8:printf("B\ 阅读全文
posted @ 2021-12-09 10:46
淘气5555
阅读(33)
评论(0)
推荐(0)

浙公网安备 33010602011771号