📄 88.c
字号:
#include <graphics.h>
#include <dos.h>
#include <bios.h>
#include <stdio.h>
/*测试显卡*/
void DetectGraphicadapter()
{
int gdriver, gmode;
puts("The information of graphics adapter is :\n");
detectgraph(&gdriver, &gmode);
if(gdriver==-2)
{
printf(">>no graphics adapter in the computer\n");
}
else
{
printf(">>Driver is %d.\n", gdriver); /*输出测试结果*/
printf(">>Mode is %d.\n\n",gmode);
}
}
/*测试硬盘*/
void DetectDisk()
{
struct dfree diskfree;
struct fatinfo fileinfo;
puts("The information of the current disk is :\n");
getdfree(0,&diskfree);
getfat(0,&fileinfo);
puts("----------------- disk space ------------------");
printf(">>The num of avaible clusters is : %d\n",diskfree.df_avail);
printf(">>The num of all clusters is : %d\n",diskfree.df_total);
printf(">>The num of bytes of every sector is : %d\n",diskfree.df_bsec);
printf(">>The num of sectors of every cluster is : %d\n",diskfree.df_sclus);
puts("----------- file allocation table -------------");
printf(">>The num of sectors of every cluster is : %d\n",fileinfo.fi_sclus);
printf(">>The num of bytes of file allocation table is : %d\n",fileinfo.fi_fatid);
printf(">>The num of clusters is : %d\n",fileinfo.fi_nclus);
printf(">>The num of ytes of every sector is : %d\n",fileinfo.fi_bysec);
}
int main()
{
/*测试显卡*/
DetectGraphicadapter();
puts("Press any key to detect the disk...");
getch();
/*测试硬盘*/
DetectDisk();
getch();
return 1;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -