C语言调用DOS命令关机,但是我不知道怎么输入时间,高手快来```
我本来是想这样弄的:#include<stdio.h>
void main()
{
char time[30];
gets(time);
system("at time shutdown -s");
}
但是不行啊....该怎么办呢??
2009-12-31 18:45
2009-12-31 20:08

2009-12-31 22:14
2009-12-31 22:18

2009-12-31 23:03
2010-01-01 17:48
2010-01-02 14:47
程序代码:#include <stdio.h>
#include <string.h>
#include <stdlib.h>
int main(){
char time[10];
char cmd[100] = "at ";
printf("输入关机时间:");
scanf("%s",time);
strcat(cmd,time);
strcat(cmd," shutdown -s");
system(cmd);
return 0;
}
2010-01-02 21:42