#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;
}