大佬们看下 为什么从子函数返回main函数之后就不会执行if了呢?而是直接return了。。
现在程序在同学电脑上(VS2013,我的电脑安装的VS2019)就可以完美运行,在我的电脑上就不能运行,当从子函数返回后就不执行if了。。。。
#include<stdio.h>
const int ceiling = 32767;
const int lower = 0;
int xxdsinput()
{
int _temp;
float temp,result;
printf("now it is outputchange\n");
again:
printf("please input 0--32767\n");
scanf_s("%d", &_temp);
if (_temp > ceiling)
{
printf("input error HOL=32767\n");
printf("return home\n\n");
return 0;
}
temp = _temp;
result =100/(ceiling/temp);
printf("result=%%%.2f\n\n", result);
goto again;
return 0;
}
int xxdsoutput()
{
int _result;
float temp=0, result=0;
printf("now it is inputchange\n");
again:
printf("please input 0%%--100%%\n");
scanf_s("%f", &temp);
if (temp > 100)
{
printf("input error HOL=100\n");
printf("return home\n\n");
return 0;
}
result = ceiling / (100 / temp);
_result = result;
printf("result=%d\n\n", _result);
goto again;
return 0;
}
int main()
{
char choose,c;
again:
printf("please choose \n");
printf("inpur=A output=B\n");
choose = getchar();
c=getchar();
if ((choose == 'a') || (choose == 'A'))
{
xxdsoutput();
goto again;
}
else if ((choose == 'b') || (choose == 'B'))
{
xxdsinput();
goto again;
}
return 0;
}