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

📄 choice.c

📁 大一时课程设计 通信录管理系统 可作为C课程设计的参考
💻 C
字号:
#include"yy.h"

void choice_item()
{
    NODE*head ;
    head=NULL ;
    while(1)
    {
    char c ;
    char s[2];
    int cn=0 ;

    while(1)
    {
        display_menu();
        printf("\t");
        gets(s);
        cn=atoi(s);
    if(cn<1||cn>9){printf("\n\t input error!please input again:\n");getch();}
        else break ;
    }
    switch(cn)
    {
        case 1 :
        head=creat(head);
        printf("\n\n\n\tpress any key to continute...\n\t");
        getch();
        break ;
        case 2 :
        head=add(head);
        printf("\n\n\n\tpress any key to continute...\n\t");
        getch();
        break ;
        case 3 :
        {
        display_del();
        while(1)
        {
            printf("\t");
            c=getch();
        if(c=='a'||c=='b')break ;
        else
        printf("\n\t input error!please choose again\n");
    }

    switch(c)
    {
        case 'a' :
        head=del_by_name(head);break;
        case 'b' :
        head=del_by_phone(head);
    }
    }

    printf("\n\n\n\tpress any key to continute...\n\t");
    getch();
    break ;
    case 4 :
    {
    display_search();
    while(1)
    {
        printf("\t");
        c=getch();
        if(c=='a'||c=='b'||c=='c')break ;
        else
            printf("\n\t input error!please choose again\n");
        }
        switch(c)
        {
            case 'a' :
            search_by_name(head); break;
            case 'b' :
            search_by_phone(head);break;
            case 'c' :
            search_by_dormitory(head);
        }
        }
        printf("\n\n\n\tpress any key to continute...\n\t");
        getch();
        break ;
        case 5 :
        show(head);
        printf("\n\n\n\tpress any key to continute...\n\t");
        getch();
        break ;
        case 6 :
        save(head);
        printf("\n\n\n\tpress any key to continute...\n\t");
        getch();
        break ;
        case 7 :
        head=readfile();
        printf("\n\n\n\tpress any key to continute...\n\t");
        getch();
        break ;
        case 8 :
        link_files();
        printf("\n\n\n\tpress any key to continute...\n\t");
        getch();
        break ;
        case 9 :
        quit(head);
        getch();
    }
    }
}

⌨️ 快捷键说明

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