#include <stdio.h>
int main() {
    printf("hello xjm \n");
    goto again;
    printf("hahahhah");
again:
    printf("lalalala");
    return 0;
}我们来看一个关机程序
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main() {
    //shutdown -s -t 60
    //system()---执行系统命令
    char input[20] = { 0 };
    system("shutdown -s -t 60");
    again:
    printf("你的电脑将会在1分钟内关机,如果输入“哈哈”,就取消关机\n");
    scanf("%s", input);
       //strcmp比较两个字符串
        if (strcmp(input, "哈哈") == 0) {
            system("shutdown -a");
        }
        else {
            //再给他一次机会,重新提示
            goto again;
        }
    return 0;
}
输入哈哈就取消关机!
原文:https://blog.51cto.com/15100290/2674775