请问如何在屏幕上输出一个float数值,谢谢。
举报
请问如何在屏幕上输出一个float数值,谢谢。
举报
#include <graphics.h>
#include <stdio.h>
#include <conio.h>
int main()
{
initgraph(400, 600);
TCHAR s[5];
_stprintf_s(s, _T("%.2f"), 2.364); // 0.2 保留两位小数
outtextxy(10, 60, s);
_getch();
closegraph();
return 0;
}