这个代码没有报错,怎么运行不了呢???
#include<stdio.h>#include<Windows.h>
int main()
{
for (int i = 0; i < 24; i++)
{
for (int a = 0; a <60; a++)
{
for (int b = 0; b <60; b++)
{
printf("%02d:%02d:%02d\n", i, a, b);
Sleep(950);
}
}
} 咋不能运行???只不过需要18000小时而已 本帖最后由 jackz007 于 2022-11-9 16:02 编辑
有错误,少了一个语句括号(右)。
#include<stdio.h>
#include<Windows.h>
int main()
{
for (int i = 0; i < 24; i++)
{
for (int a = 0; a <60; a++)
{
for (int b = 0; b <60; b++)
{
printf("%02d:%02d:%02d\n", i, a, b) ;
Sleep(950) ;
} // 少了这个语句括号
}
}
}
编译运行实况:
D:\\C>g++ -o x x.c
D:\\C>x
00:00:00
00:00:01
00:00:02
00:00:03
00:00:04
00:00:05
00:00:06
00:00:07
00:00:08
00:00:09
00:00:10
00:00:11
00:00:12
00:00:13
00:00:14
^C
D:\\C>
每秒跳一行数字
页:
[1]