yujian.c

来自「马术表演中一个很关键的子程序」· C语言 代码 · 共 63 行

C
63 行
字号
/*command line\menu*/
#include <stdio.h>
#include <stdlib.h>
main()
{
    char c=0;
    char A;
    char q=0;
    char I;
haha:   printf("1:Print a list of the commands available(a menu)\n");
        printf("2:Print information about the programprogran name,authors,copyright,year,version");
        printf("3:Exit the program\n");
       fflush(stdin);
   /*按1.2.3可分别执行命令*/

    while(c!=EOF){

    scanf("%c",&c);

    if(c=='1')
    /*1的菜单,还分三个子菜单,可以退回主菜单*/
    {printf("menu\n1.Inqure the infomoration about the equipage by entering 'I'\n2.Check the ablity of the equpage by entering 'A'\n3.Go back to the upper menu by entering 'B'\n");
    while(q!=EOF){
        scanf("%c",&q);
        if(q=='I')
        { printf("PLAYER 1\nNation:China\nName:WU Tianhang\nGender:female\nAge:20\nThe Horse Name:Handsome\n\n");

        printf("PLAYER 2\nNation:China\nName:Small long\nGender:female\nAge:25\nThe Horse Name:Fast\n\n");

        printf("PLAYER 3\nNation:China\nName:WU TianTian\nGender:male\nAge:20\nThe Horse Name:Apple\n\n");

        printf("PLAYER 4\nNation:China\nName:Yu Liang\nGender:male\nAge:24\nThe Horse Name:Happy\n\n");

        printf("PLAYER 5\nNation:China\nName:Chen Star\nGender:female\nAge:30\nThe Horse Name:Go\n\n");

        printf("PLAYER 6\nNation:China\nName:Lin Cu\nGender:female\nAge:20\nThe Horse Name:Win\n\n");

        printf("PLAYER 7\nNation:China\nName:Huang River\nGender:female\nAge:20\nThe Horse Name:Champion\n\n"); }
        else if(q=='A')
        printf("PLAYER 1:80\tPLAYER 2:88\tPLAYER 3:90\tPLAYER 4:100\tPLAYER 5:70\tPLAYER 6:87\tPLAYER 7:97\n");
        else if(q=='B')

        goto haha;}


        }
    else if(c=='2')
   {
    printf("Program name:show-jumping\n");
    printf("Authors:Yu Jian\n");
    printf("Copyright is owned by Yu only\n") ;
    printf("Year:2008\n");
    printf("Version:1.0\n\n");
    fflush(stdin);}
    else if(c=='3')
    exit(0);
    else
    {printf("You do the wrong action\n");
    goto haha;}
}
    getchar();
    }

⌨️ 快捷键说明

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