11 2021 档案

摘要:1.实现一个菜单 可以切换 ,可以返回主菜单主菜单1.登录2.注册3.输出水仙花数4.退出程序请选择: 选择后实现对应的功能 #include <stdio.h> #include <string.h> void mainMenu(); void login(); void regist(); vo 阅读全文
posted @ 2021-11-30 11:15 一颗月亮 阅读(29) 评论(0) 推荐(0)
摘要:1、编写程序,统计字符串中大写字母的个数 #include <stdio.h> main() { char str[80]; int i=0; int cnt=0; printf("请输入你的字母:"); gets(str); while ( str[i]!=0 ) { if ( str[i]>=' 阅读全文
posted @ 2021-11-30 11:08 一颗月亮 阅读(27) 评论(0) 推荐(0)
摘要:1、定义一个含有8个存储单元的实行数组,从键盘上接收数,然后逆序输出 #include <stdio.h> main() { int a[8],i,j; for( i=0;i<8;i++ ) { printf( "请输入第 %d数字",i+1 ); scanf( "%d",&a[i] ); } fo 阅读全文
posted @ 2021-11-30 11:04 一颗月亮 阅读(22) 评论(0) 推荐(0)
摘要:1 猜数字 #include <stdio.h> #include <stdlib.h> #include <time.h> main(){ int x,guess; srand((unsigned int)time(NULL)); guess=rand()%100; while(1){ print 阅读全文
posted @ 2021-11-30 11:00 一颗月亮 阅读(22) 评论(0) 推荐(0)
摘要:1. #include<stdio.h> main() { int i,j; for(i=1;j<=5;i++){ for(j=1;j<=i;j++){ printf("*"); } printf("\n"); } } 2. #include<stdio.h> main() { int i,j,k; 阅读全文
posted @ 2021-11-30 10:57 一颗月亮 阅读(14) 评论(0) 推荐(0)
摘要:编写程序,判断n是正数还是负数。 #include<stdio.h> main() { int n; printf("输入一个整数:\n"); scanf("%d",&n); if(n>0) printf("%d是正数!\n",n); else if(n==0) printf("%d既不是正数,也不 阅读全文
posted @ 2021-11-30 10:53 一颗月亮 阅读(19) 评论(0) 推荐(0)
摘要:1.编写程序判断n是正数还是负数 #include <stdio.h> main() { double n; printf("请输入一个值n="); scanf("%lf",&n); if (n>0){ printf("n是正数"); }else if (n<0){ printf("n是负数"); 阅读全文
posted @ 2021-11-30 10:49 一颗月亮 阅读(23) 评论(0) 推荐(0)
摘要:1.编写程序,将输入的分数mark(0~100)转换为相应的等级(90-100)为A,(80-89)为B,(70-79)为C,(60-69)为D,(0~59)为NO PASS! #include<stdio.h> main() { int mark; printf("输入学生的分数(0-100):" 阅读全文
posted @ 2021-11-30 10:45 一颗月亮 阅读(38) 评论(0) 推荐(0)
摘要:1.判断一个数n是正数还是负数 #include<stdio.h> main() { float n; printf("请输入一个数"); scanf("%f",&n); if (n>0){ printf("正数\n"); }else if (n==0){ printf("输出的数为0\n"); } 阅读全文
posted @ 2021-11-30 10:38 一颗月亮 阅读(24) 评论(0) 推荐(0)
摘要:1.编写程序,输出“我爱学习C语言!” #include<stdio.h> main() { printf("我爱C语言!\n"); } 2.分行输出自己的专业和姓名 #include<stdio.h> main() { printf("信息与控制工程系\n计算机科学技术\n李金燕"); } 3.用 阅读全文
posted @ 2021-11-30 10:30 一颗月亮 阅读(21) 评论(0) 推荐(0)