会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
城北徐公135
博客园
首页
新随笔
联系
订阅
管理
上一页
1
2
3
4
5
6
7
下一页
2022年1月20日
47.习题二
摘要: #include<stdio.h>/*菲波那切数列:1、1、2、3、5、8、13、21、34.。。。。(从第三个数开始,该数是其前两个数的和)。要求由低到高输出菲波那切数列能被3整除的10个数,然后再由低到高的顺序输出菲波那切数列不能被2整除的10个数 */ int main(){int a,b,c
阅读全文
posted @ 2022-01-20 17:25 城北徐公135
阅读(34)
评论(0)
推荐(0)
2022年1月19日
上机1 计算a+b
摘要: #include<stdio.h>/*基本输入输出题(一)题目描述;计算a+b输入包括两个正整数a,b(1<a,b<=10^9),输入数据包括多组。输出a+b的结果输入1 510 20输出630 */int main(){ int a,b; while(scanf("%d%d",&a,&b)){ p
阅读全文
posted @ 2022-01-19 18:21 城北徐公135
阅读(137)
评论(0)
推荐(0)
46.打印 1 2 3 4 5 2 4 6 8 10 3 6 9 12 15 4 8 12 16 20
摘要: #include<stdio.h>#include"D:\39.h"int main(){ for(int j=1;j<=4;j++){ for(int i=1;i<=5;i++){ printf("%5d",i*j); } // printf("\n"); putchar('\n'); } ret
阅读全文
posted @ 2022-01-19 12:35 城北徐公135
阅读(100)
评论(0)
推荐(0)
42.continue
摘要: #include<stdio.h>#include"D:\39.h"int main(){ for(int i=1;i<=100;i++){#if 0 if(i%3==0) continue; printf("%d\n",i);#else if(i%3!=0) printf("%d\n",i);#e
阅读全文
posted @ 2022-01-19 12:21 城北徐公135
阅读(32)
评论(0)
推荐(0)
break
摘要: #include<stdio.h>#include"D:\39.h"int main(){ int a,sum=0; for(int i=1;i<=10;i++){ scanf("%d",&a); sum+=a; if(sum>=1000) break; } printf("总的捐款数为%d\n",
阅读全文
posted @ 2022-01-19 12:12 城北徐公135
阅读(31)
评论(0)
推荐(0)
41.求1-5阶乘的和
摘要: #include<stdio.h>#include"D:\39.h"int main(){ int i=1,s=1,sum=0; do{ s*=i; sum+=s; ++i; }while(i<=5); printf("%d\n",sum); return 0;}
阅读全文
posted @ 2022-01-19 12:00 城北徐公135
阅读(258)
评论(0)
推荐(0)
40 输入三个数,倒序排列
摘要: #include<stdio.h>#include"D:\39.h"int main(){ int d,a,b,c; scanf("%d%d%d",&a,&b,&c); if(a>b){ d=a; a=b; b=d; } if(a>c){ d=a; a=c; c=d; } if(b>c){ d=b;
阅读全文
posted @ 2022-01-19 11:48 城北徐公135
阅读(33)
评论(0)
推荐(0)
39.头文件
摘要: 头文件 #define PI 3.1415int E = 123;int max(int x,int y){ if(x>y) return x; else return y;} 引用头文件 #include<stdio.h>#include"D:\39.h"int main(){ printf("%
阅读全文
posted @ 2022-01-19 11:33 城北徐公135
阅读(42)
评论(0)
推荐(0)
2022年1月18日
38.switch语句
摘要: #include<stdio.h> #include<math.h> /**/ int main(){ printf("请输入所要到达的楼层:"); int a; scanf("%d",&a); switch(a){ case 1: printf("上一楼\n"); break; case 2: p
阅读全文
posted @ 2022-01-18 22:34 城北徐公135
阅读(43)
评论(0)
推荐(0)
37.布尔数据类型
摘要: #include<stdio.h> #include<math.h>#include<stdbool.h> //该文件中有_Bool这个数据类型,_Bool与bool是同义词,vc++中没有这个头文件 /*布尔数据类型也是整型数据的一种 */ int main(){ //定义布尔型变量 c99中的新
阅读全文
posted @ 2022-01-18 19:30 城北徐公135
阅读(149)
评论(0)
推荐(0)
上一页
1
2
3
4
5
6
7
下一页
公告