用C/C++写的简易电子钟
lllcccaaa:
更精确
用C/C++写的简易电子钟
lllcccaaa:
又给你改了一下:
[code=cpp]
int main()
{
CONSOLE_CURSOR_INFO cciCursor;
HANDLE hStdOut = GetStdHandle(STD_OUTPUT_HANDLE);
if(GetConsoleCursorInfo(hStdOut, &cciCursor))
{
cciCursor.bVisible = FALSE;
SetConsoleCursorInfo(hStdOut, &cciCursor);
}
system("mode con cols=48 lines=9");
SYSTEMTIME sys;
while(1)
{
GetLocalTime(&sys); //获得系统的时间
NumDisplay(sys.wHour,0,1);
DotDisplay(14,2);
NumDisplay(sys.wMinute,16,1);
DotDisplay(32,2);
NumDisplay(sys.wSecond,35,1);
GetLocalTime(&sys);
}
return 0;
}
[/code]
用C/C++写的简易电子钟
lllcccaaa:
我给你加了行system("mode con cols=48 lines=9");
用C/C++写的简易电子钟
lllcccaaa:
[code=cpp]#include
#include
void NumDisplay(int num,int x,int y); //数显函数
void SetPosition(int x,int y); //设置输出位置函数
int *SeparateNum(int num); //将两位数分开的函数
void DotDisplay(int x,int y); //时钟点显示函数
static int NumGroup[2]; //设置一个静态变量存放分开的两位数
int main()
{
system("mode con cols=48 lines=9");
SYSTEMTIME sys;
while(1)
{
GetLocalTime(&sys); //获得系统的时间
NumDisplay(sys.wHour,0,1);
DotDisplay(14,2);
NumDisplay(sys.wMinute,16,1);
DotDisplay(32,2);
NumDisplay(sys.wSecond,35,1);
Sleep(1*1000); //延时1s
}
return 0;
}
void NumDisplay(int num,int x,int y)
{
int *num_group,i;
num_group=SeparateNum(num);
for(i=0;i<2;i++) //时、分、秒都是两位,所以两次循环分别打印
{
if(i==0) num=num_group[0];
else num=num_group[1];
switch(num)
{
case 0:
SetPosition(x+i*7,y); printf("######");
SetPosition(x+i*7,y+1);printf("# #");
SetPosition(x+i*7,y+2);printf("# #");
SetPosition(x+i*7,y+3);printf("# #");
Set
[/code]
三相感应电机在ABC坐标下状态方程的数值解法
QQ音乐:
运行不出,显示警告: 矩阵为奇异值、接近奇异值或缩放错误。结果可能不准确。RCOND = NaN。
💡 关键要点
用C/C++写的简易电子钟 lllcccaaa: 更精确 用C/C++写的简易电子钟 lllcccaaa: 又给你改了一下: [code=cpp] int main() { CONSOLE_CURSOR_INFO cciCursor; HANDLE hStdOut = G