码迷,mamicode.com
首页 > 其他好文 > 详细

array-03.c

时间:2018-07-06 01:32:32      阅读:134      评论:0      收藏:0      [点我收藏+]

标签:ase   pre   \n   ++   highlight   void   The   array   else   

#include <stdio.h>
#include <stdlib.h>
void main()
{
    int Employee[10] = { 27000, 32000, 32500, 27500,
                    28500, 29000, 31000, 32500, 30000, 26000};
    int Salary;
    int Counter = 0;
    int i;

    printf("Please input the employee salary: ");
    scanf("%d", &Salary);
    for ( i = 0; i < 10; i++)
    {
        if (Salary == Employee[i])
        {
            printf("Number %d Employee‘s salary is %d!\n", i, Salary);
            Counter++;
        }
    }
    if (Counter == 0)
    {
        printf("No employee‘s salary is %d!!\n", Salary);
    }
    else
    {
        printf("Have %d employees salary is %d!!\n", Counter, Salary);
    }

}

  

array-03.c

标签:ase   pre   \n   ++   highlight   void   The   array   else   

原文地址:https://www.cnblogs.com/lifelessfaultless/p/9271289.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!