为啥总是提示“运行错误”
#include<stdio.h>#include<conio.h>
#include<stdlib.h>
#include<windows.h>
#include<string.h>
#define N 5
void putdata(int* a)
{ int i;
for(i=0;i<N;i++)
a[i]=rand()%10;
for(i=0;i<N;i++)
printf("%d",a[i]);
Sleep(3000);
system("cls");/*三秒后清屏*/
}
void getdata(int*b)
{ int i=0;
do
{ scanf("%d",b[i]);
i++;
}
while(isdigit(b[i])&&i<5);/*当i是整数并且i小于5*/
}
int comdata(int*a,int*b)
{ int i,count=0;
for(i=0;i<N;i++)
{if(a[i]=b[i])
count++;
}
return count;
}
void getlevel(int n)
{ printf("put the result\n");
switch(n/N*10)
{ case 10:
case 9 :printf("Great\n");break;
case 8 :printf("Very good\n");break;
case 7 :printf("Good\n");break;
default:printf("Come on\n");break;
}
}
void main(void)
{int a[N],i,b[N],n;
printf("Put the original number\n");
putdata(a);
getdata(b);
n=comdata(a,b);
getlevel(n);
}