![](https://img-blog.csdnimg.cn/20201014180756780.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
知识点
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 · 90 阅读 · 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 · 169 阅读 · 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 · 337 阅读 · 0 评论