#include <stdio.h>
#include <process.h>
int main()
{
int check;
int enter[7];
int i,j;
printf("enter any 7 number to be stored");
for(i = 0; i < 7; i++)
scanf("%d" ,&enter[i]);
printf("\nenter any number to check:");
scanf("%d" ,&check);
for (i = 0; i < 7; i++)
{
if (enter[i]=check)
{
printf("your entry is valid");
exit(0);
}
else if(enter[6]!=check)
{
printf("your entry is not valid");
exit(0);
}
else
continue;
}
return 0;
}
这执行没有错误但不能正常工作..总是打印出输入是有效的..即使我输入了不在数组中的数字:(