![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
嵌入式小题
~毅~
这个作者很懒,什么都没留下…
展开
-
输入函数垃圾处理
当我们需要输入俩个数#include<stdio.h.main(){ int a; char b; scanf("%d%s",&a,&b); printf("%d%s",a,b);}``输入 2回车3会发现输出的是 2和回车那么回车字符便是我们想要删除的垃圾。三种方法(1)用getch();直接读取回车不输出(2)再输入那里加空...原创 2018-12-09 15:40:07 · 361 阅读 · 0 评论 -
一元二次方程求解---C语言
#include<stdio.h>#include<math.h>#define b2 pow(b,2)#define b1 (4*a*c)#define dat (b2-b1)main(){ float a, b, c, x1, x2; printf("Enter the values of a,b, and c:"); scanf("%f\n%f\n%...原创 2018-12-10 15:15:25 · 1555 阅读 · 0 评论 -
三角形面积
#include<stdio.h>#include<math.h>#define p (a+b+c)/2main(){ float a, b, c, S; printf("输入三角形三条边长以','结束:\n>>"); scanf("%f,%f,%f",&a,&b,&c); if(a+b>c&原创 2018-12-11 09:45:08 · 155 阅读 · 0 评论 -
九九乘法表——三角形
#include<stdio.h>main(){ int i, o, p, u; for(i=1;i<=9;i++) { for(o=1;o<=i;o++) { printf(" ");//俩个空格 } for(p=1;p<=(10-i);p++) { u=i*p; printf("%d*%d=%d ...原创 2018-12-11 21:39:37 · 3304 阅读 · 1 评论 -
水仙花
#include<stdio.h>main(){ int a=1, g, s, b; while(a<=1000) { b=a/100; s=a/10%10; g=a%10; if(b*b*b+s*s*s+g*g*g==a) printf("%d\n",a); a++; }}原创 2018-12-11 22:22:26 · 337 阅读 · 0 评论