C语言 第2。3个功能输出不了

来源:百度知道 编辑:UC知道 时间:2024/05/15 16:37:28
#include<stdio.h>
#include <stdlib.h>
int main ( )
{
int newsalary;//员工新工资
int selection;//选择
int index;//引索
int Employee[10]={27000,32000,32500,27500,28500,29000,31000,32500,30000,26000};//工资
while(1) // while 循环机构
{
printf("===============================================================\n");
printf(" = Simple Employee Salary Management System =\n");
printf(" = 1. Display employee salary =\n");//显示工资
printf(" = 2. Modify employee salary =\n ");//修改工资
printf("= 3. Quit =\n");
printf("=================================================================\n");
printf("Please input your selection:");
scanf("%d",&selection);//输入选项
if (selection ==1||selection==2) //对选项 做出第一次筛选
{
printf("Please input the employee number:");
scanf("%d",&i

switch(selection)// 对选项 做出第2次筛选
{
case '1'://改成case 1
break;
case '2'://改成case 2
printf("Please input the employee's Newsalary:");//修改员工新工资
scanf("%d",&newsalary);
Employee[index]=newsalary;
//printf("the employee's Newsalary is %d",Employee[index]);
break;
case '3'://改成case 3
exit (1);
break;
}