查找数组中元素

1. 代码

#include <stdio.h>

int main()
{
    int a[6]={60,75,95,80,65,90},b;
    scanf("%d",&b);
    if(b!=a[0]&&b!=a[1]&&b!=a[2]&&b!=a[3]&&b!=a[4]&&b!=a[5])
    {
        printf("Not Included\n");
    }
    else
    {
        printf("Included");
    }
    return 0;
}

2. 测试

posted @ 2023-11-05 20:33  20231413张桓溪  阅读(9)  评论(0编辑  收藏  举报