⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 gotoit.c

📁 里面包含很多c语言的源码
💻 C
字号:
/* Demonstrates the goto statement */

#include <stdio.h>

int main( void )
{
    int n;

start:

    puts("Enter a number between 0 and 10: ");
    scanf("%d", &n);

    if (n < 0 ||n > 10 )
        goto start;
    else if (n == 0)
        goto location0;
    else if (n == 1)
        goto location1;
    else
        goto location2;

location0:
    puts("You entered 0.\n");
    goto end;

location1:
    puts("You entered 1.\n");
    goto end;

location2:
    puts("You entered something between 2 and 10.\n");

end:
    return 0;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -