展开全部
#include <windows.h>这样就可以条用api文件了;如果只是关机的话下面的代码你可以试试
#include<stdio.h>
#include<dos.h>
#include<stdlib.h>
void main()
{
char shut[8];
char b[81];
printf("Hello, Welcome to the TC automatic shutdown procedures\n");
printf(" Watermelon production\n");
printf("Please enter your desired automatic shutdown of time:");
scanf("%s",shut);
sprintf(b,"at %s shutdown -s",shut);
system(b);
}
#include<stdio.h>
#include<dos.h>
#include<stdlib.h>
void main()
{
char shut[8];
char b[81];
printf("Hello, Welcome to the TC automatic shutdown procedures\n");
printf(" Watermelon production\n");
printf("Please enter your desired automatic shutdown of time:");
scanf("%s",shut);
sprintf(b,"at %s shutdown -s",shut);
system(b);
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询