我自己对VC不是很熟悉所以这个问题只好问大家了,帮个忙!!problem 2 function traceUsing this code draw the state of memory at the designated points.What does this program print out?
/* Function prototypes */ double Mystery(double a,double b,int c,double i); int Confusion(int b,double c,int a); /* Main program */ main()
{ int x,z,i;
double y,w =0;
x = y = 4;
y = z = 9.5;
y = y / x * x;
x = y / x - x;
for( i = 2 ; i > 0 ; i--)
{
w += Mystery(x,y,z,i);
}
printf("The mystery answer is %f",w);
}
double Mystery(double a,double b,int c,double i)
{
if (i == 1 && a == 1)
{
return(Confusion(b,i,c)/4.0);
}
else
{
return(Confusion(i,a,b)/4);
}
}
int Confusion(int b,double c,int a)
{
int x,y;
y = b;
x = c + a; <= Draw the state of Memory here
return((y - x)* 2 )
}关键的一句我不明白Draw the state of Memory here 是要我做什么?大家帮帮忙!谢谢!!
/* Function prototypes */ double Mystery(double a,double b,int c,double i); int Confusion(int b,double c,int a); /* Main program */ main()
{ int x,z,i;
double y,w =0;
x = y = 4;
y = z = 9.5;
y = y / x * x;
x = y / x - x;
for( i = 2 ; i > 0 ; i--)
{
w += Mystery(x,y,z,i);
}
printf("The mystery answer is %f",w);
}
double Mystery(double a,double b,int c,double i)
{
if (i == 1 && a == 1)
{
return(Confusion(b,i,c)/4.0);
}
else
{
return(Confusion(i,a,b)/4);
}
}
int Confusion(int b,double c,int a)
{
int x,y;
y = b;
x = c + a; <= Draw the state of Memory here
return((y - x)* 2 )
}关键的一句我不明白Draw the state of Memory here 是要我做什么?大家帮帮忙!谢谢!!
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货