无法运行,遇到好几回了
我用的vc++6.0Error: Could not generate command line for the 32-bit C/C++ Compiler for 80x86 tool.
这是咋回事啊 代码?? 把代码贴上来 #include<stdio.h>
void main(void)
{
int sqrt_02(int question);
int question=50,answer;
answer=sqrt_02(question);
if(answer<0)
printf("ERROR:sqrt returns %d\n",answer);
else
printf("The squart root of %d is %d\n",question,answer);
}
int sqrt_02(int question)
{
int temp=quertion/2;
while(temp--)
{
if(temp*temp==question)
return temp;
}
return -1;
} 我觉得是你的主函数写错了。应该是int main() int sqrt_02(int question)
{
int temp=quertion/2; //这里写错了,quertion应该是question
正确的实现:
#include<stdio.h>
void main(void)
{
int sqrt_02(int question);
int question=36,answer;
answer=sqrt_02(question);
if(answer<0)
printf("ERROR:sqrt returns %d\n",answer);
else
printf("The squart root of %d is %d\n",question,answer);
return;
}
int sqrt_02(int question)
{
int temp=question/2;
while(temp--)
{
if(temp*temp==question)
return temp;
}
return -1;
}
#include<stdio.h>
void main(void)
{
int sqrt_02(int question);
int question=36,answer;
answer=sqrt_02(question);
if(answer<0)
printf("ERROR:sqrt returns %d\n",answer);
else
printf("The squart root of %d is %d\n",question,answer);
return;
}
int sqrt_02(int question)
{
int temp=question/2;
while(temp--)
{
if(temp*temp==question)
return temp;
}
return -1;
} 感谢
页:
[1]