1.没有进行字符串转换,程序大小48B- #include<reg52.h>
- #include<stdio.h>
- #define uchar unsigned char
-
- float fengsu;
- long guang;
- uchar str[10];
- void display1()
- {
- guang=60000;
- // sprintf(str,"%5ld",guang);
- }
- void display2()
- {
- fengsu=12.34;
- //sprintf(str,"%5.2f",fengsu);
- }
- void main()
- {
- while(1)
- {
- display1();
- display2();
- }
- }
复制代码
|