c语言浮点错误怎么改,萌新不懂什么是浮点错误,求教怎么修改(求问如何使次程序变美观)...

该楼层疑似违规已被系统折叠 隐藏此楼查看此楼

#include

int main()

{

int num;

scanf("%d",&num);

if(num<0)

{

printf("fu ");

num=-num;

}

int b=1;

int c=num;

while (c>9)

{

c/=10;b*=10;

}

int notch,ari;

while(num>=0)

{

notch=num/b;

ari=num%b;

switch (notch)

{

case 1:

if(b>1)

{

printf("yi ");

}else

{

printf("yi");

}

break;

case 2:

if(b>1)

{

printf("er ");

}else

{

printf("er");

}

break;

case 3:

if(b>1)

{

printf("san ");

}else

{

printf("san");

}

break;

case 4:

if(b>1)

{

printf("si ");

}else

{

printf("si");

}

break;

case 5:

if(b>1)

{

printf("wu ");

}else

{

printf("wu");

}

break;

case 6:

if(b>1)

{

printf("liu ");

}else

{

printf("liu ");

}

break;

case 7:

if(b>1)

{

printf("qi ");

}else

{

printf("qi");

}

printf("qi ");

break;

case 8:

if(b>1)

{

printf("ba ");

}else

{

printf("ba");

}

break;

case 9:

if(b>1)

{

printf("jiu ");

}else

{

printf("jiu ");

}

break;

case 0:

if(b>1)

{

printf("ling ");

}else

{

printf("ling");

}

break;

}

b/=10;

num=ari;

}

return 0;

}

你可能感兴趣的:(c语言浮点错误怎么改)