简单工人工资管理系统

简单工人工资管理系统_第1张图片

int main(int argc, char *argv[])
{
int Employee[10] = {27000,32000,32500,27500,28500,29000,31000,32500,3000,2600};

int Index;
int NewSalary;
int Selection;

while (1)
{
    printf("===================================================\n");
    printf(" simple employee salary mangement system \n");
    printf(" 1. dispaly employee salary                        =\n");
    printf(" 2. modify employee salary  \n");
    printf(" 3. exit\n");

    printf("===================================================\n");
    printf(" please input your choose \n");
    scanf("%d",&Selection);

    if((Selection == 1 )|| (Selection == 2))
    {
         printf(" please input employee number \n");
         scanf("%d",&Index);
         if(Index < 10)
         {
              printf("Employee number is %d \n",Index);
              printf("The Salary is %d \n",Employee[Index]);
         }
         else
         {
            printf("The error Employee number \n");
            exit(1);
         }
    }
    switch (Selection)
    {
        case 1:

            break;
        case 2:
            printf(" Please input new salary \n");
            scanf("%d",&NewSalary);
            Employee[Index] = NewSalary;
            break;

        case 3:
            exit(1);
            break;
    }
    printf(" \n");
}

return 0;

}

你可能感兴趣的:(数据结构和算法,算法)