知识点
2021年01月29日
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
分支结构程序设计
1.分段函数 对于不同的条件,进行不同的计算、输出 #include<stdio.h> int main() { int n; int h; scanf("%d",&n); if(n<0) h=-1; if(n==0) h=0; if(n>0) h=1; printf("sign(%d) = %d",n,h) ; return 0; } 2.比较大小 设置变量t,帮助完成置换 #include <stdio.h> i原创 2022-03-23 12:12:04 · 164 阅读 · 0 评论 -
简单的输入
理解:可依据输出值,进行一系列运算后,输出没办法直接输出的内容 例子: #include <stdio.h> #include <math.h> int main() { double x,y,z; scanf("%lf",&x); y = pow(1+x,365); z = pow(1-x,365); printf("%.8f\n%.8f",y,z); return 0; } #include<stdio.h&原创 2022-01-06 23:30:55 · 220 阅读 · 0 评论 -
简单的输出
理解:直接在printf中表达A,代码运行后就会出现A 例子: #include<stdio.h> int main() { printf("请输入班级人数:"); return 0; } 请输入班级人数: -------------------------------- Process exited after 0.06282 seconds with return value 0 请按任意键继续. . . 注意:框架+输出 ...原创 2022-01-06 22:30:25 · 391 阅读 · 0 评论
分享