c 语言程序字体问题

来源:百度知道 编辑:UC知道 时间:2024/06/01 19:08:50
#include<stdio.h>
#include<stdlib.h>
#include"bios.h"

int main()
{
int i,j;
while(1)
{
system("cls");
i=rand()%82;
printf("%d",i);
for(j=0;j<150;j++)1;
if(bioskey(1)!=0)break;
}
printf("\nYOUR NMUBER IS : %d",i);
system("pause");
return 0;

}
如何能把输出字体变大最好是很大的那种
而且能让他输出结果时能循环继续随机输出
不是现实结果 按任意键退出那种。
回答对者给高分 而且加追加
就算1楼所说.请你们运行下。. 我把它转成exe文件.但是远行一次显示结果按任意键退出.能不能继续按任意键出现随机数字!

DOS 命令窗的字体没办法变得很大。
如果只输出数字,你可以用图案的方法自己定10个数字。例如:2
*****
++++*
*****
*++++
*****
(+号处用空白)

c 语言 Win32 API 的窗可以自己设置。
自己可以定义字体,例如
LOGFONT lf;
lf.lfHeight = 240; // 高
lf.lfWidth = 120; // 宽
lf.lfEscapement = m_ang;
lf.lfOrientation = m_ang; //方向
lf.lfWeight = 520; // 粗细
lf.lfItalic = 0;
lf.lfUnderline = 0; // 有无下划线
lf.lfStrikeOut = 0;
lf.lfCharSet = GB2312_CHARSET; //中文国标码字符集
lf.lfOutPrecision = 0;
lf.lfClipPrecision = CLIP_STROKE_PRECIS;
lf.lfQuality = 0;
lf.lfPitchAndFamily = 0;
strcpy(lf.lfFaceName, "MS Song"); //字体名
然后 用下面函数 建 字体
HFONT CreateFontIndirect(
const LOGFONT *lplf
);
再下来是“画字体", 调SDK 函数
BOOL TextOut(
HDC hdc, // handle to DC
int nXStart, // x-coordinate of starting position
int nYStart, // y-coordinate of starting position
LPCTSTR lpString, // character stri