大家好,又见面了,我是你们的朋友全栈君。int main() { char input[10]; system(“shutdown -s -t 60”); //60为设置的时间,60秒之后将关机 again: printf(“电脑即将关机,输入“我是猪”,即可停止\n”); scanf(“%s”, input); if (strcmp(“我是猪”,input) == 0) { system(“shutdown -a”); } else { goto again; } system(“pause”); return 0; }
发布者:全栈程序员栈长,转载请注明出处:https://javaforall.cn/162959.html原文链接:https://javaforall.cn