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