[求助]猜数 我哪错了
#include<math.h>#include<stdlib.h>
#include<process.h>
#include<stdio.h>
#include<time.h>
void main()
{
int answer[4],guess,a,b,times=0,i,j;
for(i=0;i<=3;i++){
srand(time(NULL));
answer[i]=rand()%10;
for(j=0;j<i;j++){
while(answer[i]==answer[j]){
answer[i]=rand()%10;
j=-1;}}}
printf("please guess:\n");
while(a!=4){
a=0;
b=0;
times++;
do{printf("%d ",times);
scanf("%d",&guess);
if(guess==0) exit(0);}
while(guess<0||guess>9999);
for(i=3;i>-1;i--){
for(j=0;j<4;j++) {
if((int)(guess/pow(10,i))==answer[j]);
{if(i+j==3) a=+1;
else b=b+1;}
}guess=guess-(int)(guess/pow(10,i)*pow(10,i);}
printf(" %dA%dB\n",a,b) ;
}}
请帮帮忙!