求改错 pow 函数问题?
#include<iostream>#include<math>
using namespace std;
int main()
{
int answer[4]={1,3,5,2},guess,a,d,times=0,i,j;
cout<<"Please guess"<<endl;
while(a!=4)
{
int a=0,b=0;
times++;
cout<<"The guess numbers is:"<<times<<endl;
scanf("%d",&guess);
for(i=3;i<-1;i--)
for(j=0;j<4;j++)
{
if((int)(guess/pow10(i))=answer[j]);
if(i+j==3)
a=a+1;
else
b=b+1;
}
guess=guess-(int)(guess/pow10(i))*pow10(i);
printf("%da%db\n",a,b);}
system("pause");
return 0;
}