会员
周边
新闻
博问
闪存
众包
赞助商
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
徐赫彤
博客园
首页
新随笔
联系
订阅
管理
1
2
下一页
2021年11月30日
第十二次作业
摘要: 1.输入一个三位数,求个位,十位,百位 #include<stdio.h> main() { int a=857; int ge=a%10; int shi=a/10%10; int bai=a/100; printf("个位是%d,十位是%d,百位是%d",ge,shi,bai); } 2.输入一
阅读全文
posted @ 2021-11-30 10:21 徐赫彤
阅读(35)
评论(0)
推荐(0)
2021年11月28日
第十一次作业
摘要: 1.实现一个菜单,可以切换,可以返回主菜单。(主菜单:1.登录 2.注册 3.输出水仙花数 4.退出程序。请选择: 选择后实现对应的功能) #include <stdio.h> #include <string.h> void mainMenu(); void login(); void regis
阅读全文
posted @ 2021-11-28 13:13 徐赫彤
阅读(23)
评论(0)
推荐(0)
2021年11月24日
第一次作业
摘要: 编写程序,输出“我爱学习c语言!”。 #include<stdio.h> main() { printf("我爱学习c语言!"); } 分行输出自己的专业和姓名 复制代码 #include<stdio.h> main() { printf("*****************************
阅读全文
posted @ 2021-11-24 13:27 徐赫彤
阅读(16)
评论(0)
推荐(0)
第十次作业
摘要: 1.用循环结构求字符串的长度。 #include<stdio.h> main() { char str[80]; int i=0; int length=0; gets(str); puts(str); while(str[i++]!='\0') length++; printf("字符串的长度为:
阅读全文
posted @ 2021-11-24 13:22 徐赫彤
阅读(31)
评论(0)
推荐(0)
2021年11月20日
第九次作业
摘要: 1 定义一个含有八个存储单元的实型数据,从键盘上接收数,然后逆行输出。 #include<stdio.h> main() { int number[8]; int i; for(i=1;i<8;i++){ scanf("%d",&number[i]); } for(i=7;i>=1;i--){ pr
阅读全文
posted @ 2021-11-20 13:42 徐赫彤
阅读(16)
评论(0)
推荐(0)
2021年11月15日
第八次作业
摘要: 猜数字: 随机产生一个0-99的数,猜猜看 如果大了 就提示大了点 如果小了 就提示小了点 直到猜对为止 #include <stdio.h> #include <stdlib.h> #include <time.h> main(){ int x,guess; srand((unsigned int
阅读全文
posted @ 2021-11-15 17:57 徐赫彤
阅读(28)
评论(0)
推荐(0)
2021年11月9日
第七次作业
摘要: 1. * ** *** **** ***** #include<stdio.h> main() { int i,j; for(i=1;i<=5;i++){ for(j=1;j<=i;j++){ printf("*"); } printf("\n"); } } ******* ***** *** *
阅读全文
posted @ 2021-11-09 10:12 徐赫彤
阅读(20)
评论(0)
推荐(0)
2021年11月5日
第六次作业
摘要: 1.编写程序,使用while语句求和sum=1+3+5+…+21. #include<stdio.h> main() { int i=1;int sum=0; while(i<=21) { sum+=i; i+=2; } printf("Sum=%d\n",sum); } 2.编写程序,使用whil
阅读全文
posted @ 2021-11-05 22:01 徐赫彤
阅读(23)
评论(0)
推荐(0)
2021年10月29日
第五次作业
摘要: 1.编写程序判断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-10-29 20:50 徐赫彤
阅读(14)
评论(0)
推荐(0)
2021年10月28日
第四次作业
摘要: 1. #include<stdio.h> main() { int mark; printf("请输入学生的分数(0-100):\n"); scanf("%d",&mark); switch(mark/10) { case 10://与case9:公用同一条语句 case 9:printf("A\n
阅读全文
posted @ 2021-10-28 20:47 徐赫彤
阅读(20)
评论(0)
推荐(0)
1
2
下一页
公告