# 输入一个数查找比它小的元素

<p>一个整型数组有10元素&#xff0c;请先给这10个元素赋值&#xff0c;然后随便输入一个数&#xff0c;最后输出数组中比这个数小的所有元素&#xff0c;每个数用空格隔开&#xff0c;如果没有找到&#xff0c;则输出not find。<br />
 </p>
<p style="text-align:center"><img alt="" src="https://img-service.csdnimg.cn/img_convert/ca7823918ff2609bfc9edc9c4d84ab3c.jpeg" />
 </p>

以下程序实现了这一功能，请你填补空白处内容：

```cpp
#include <stdio.h>
int main()
{
    int a[10], i, n;
    int isfind = 0;
    printf("please set array values:");
    for (i = 0; i < 10; i++)
        scanf("%d", &a[i]);
    printf("please enter one num:");
    scanf("%d", &n);
    for (i = 0; i < 10; i++)
    {
		______________;
    }
    if (isfind)
        printf("\n");
    else
        printf("not find\n");
    return 0;
}
```

## template

```cpp
#include <stdio.h>
int main()
{
    int a[10], i, n;
    int isfind = 0;
    printf("please set array values:");
    for (i = 0; i < 10; i++)
        scanf("%d", &a[i]);
    printf("please enter one num:");
    scanf("%d", &n);
    for (i = 0; i < 10; i++)
    {
		if (a[i] < n)
        {
            isfind = 1;
            printf("%d ", a[i]);
        }
    }
    if (isfind)
        printf("\n");
    else
        printf("not find\n");
    return 0;
}
```

## 答案

```cpp
if (a[i] < n)
{
	isfind = 1;
	printf("%d ", a[i]);
}
```

## 选项

### A

```cpp
if (a[i] < n)
{
	isfind = 0;
	printf("%d ", a[i]);
}
```

### B

```cpp
if (a[i] > n)
{
	isfind = 1;
	printf("%d ", a[i]);
}
```

### C

```cpp
if (a[i] > n)
{
	isfind = 0;
	printf("%d ", a[i]);
}
```