用stm32cubemx配置好串口功能之后,想要使用printf函数进行打印输出的话,还需要自己添加一个重定向函数。 1 #ifdef __GNUC__ 2 /* With GCC/RAISONANCE, small printf (option LD Linker->Libraries->Smal ...
分类:
其他好文 时间:
2021-04-20 15:06:54
阅读次数:
0
代码: #include <stdio.h> #include <stdlib.h> /* run this program using the console pauser or add your own getch, system("pause") or input loop */ int ma ...
分类:
其他好文 时间:
2021-04-20 14:10:46
阅读次数:
0
#include<cstdio> const double eps = 1e-5; double f(double x) { return x * x; } double calSqrt() { double mid,left=1,right=2; while (right - left > eps ...
分类:
其他好文 时间:
2021-04-20 14:03:49
阅读次数:
0
1 // 变长参数传递与两个函数之间 2 template <class... Args> 3 void myTest(Args... args) { 4 printf("%d,%d,%d,%d", args...); 5 } 6 int main() { 7 myTest(1, 2, 3, 4); ...
分类:
其他好文 时间:
2021-04-19 15:50:56
阅读次数:
0
前言: 手写GO用反射读取ini配置文件。 实例代码: package main import ( "errors" "fmt" "io/ioutil" "reflect" "strconv" "strings" ) // ini配置文件解析器 // MysqlConfig MySQL配置结构体 t ...
分类:
其他好文 时间:
2021-04-19 15:03:58
阅读次数:
0
该文可以快速在Go语言中获得时间的计算。 在Go中获取时间 如何获取当前时间 now := time.Now() fmt.Printf("current time is :%s", now) current time is :2009-11-10 23:00:00 +0000 UTC m=+0.00 ...
分类:
编程语言 时间:
2021-04-14 12:35:07
阅读次数:
0
输入一个数,分解成其质因子 1 #include<stdio.h> 2 3 int main() 4 { 5 int val,temp; 6 scanf("%d", &val); 7 printf("%d=1*", val); 8 temp = val; 9 for (int i = 2; i < ...
分类:
其他好文 时间:
2021-04-14 11:57:55
阅读次数:
0
#include<stdio.h> int main() { int a=1; int b=1; if(a==b) { printf("相等"); } else { printf("不相等"); } return 0; } ...
分类:
编程语言 时间:
2021-04-13 12:15:37
阅读次数:
0
二叉树本身是一种递归的数据类型,二叉树的许多操作离不开递归。非递归遍历包括结点入栈,先访问右子树,再访问根节点,访问左子树,先序和后序的非递归算法有待调试。 #include <stdio.h> #include<stdlib.h> #include<stdbool.h> typedef char ...
分类:
编程语言 时间:
2021-04-12 12:56:41
阅读次数:
0
1 #include<stdio.h> 2 int main() 3 { 4 float num; 5 int temp; 6 scanf("%f",&num); 7 temp=num*100+0.5; 8 num=(double)temp/100; 9 printf("%f",num); //不同 ...
分类:
其他好文 时间:
2021-04-12 12:28:11
阅读次数:
0