c语言简易菜单的制作

使用switch语句

img

#include<stdio.h>
int main()
{
    printf(":)Welcome to the experiments of Euler's constante.\n");
    printf(":)The system has chosen four formulas to compute e.\n");
    printf(":)Please picka choice shown on the menu:\n");
    printf("==============Menu===============\n");
        printf("a.Use formula(a) to compute e.\n");    
    printf("b.Use formula(b) to compute e.\n");    
    printf("c.Use formula(c) to compute e.\n");    
    printf("d.Use formula(d) to compute e.\n");    
    printf("e.Print e.\n");
    printf("f.Some action\n");
    printf("q.Quit\n");
        printf("==============================");
return 0; 
}