| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1017 人关注过本帖
标题:求教,这有一个程序,可以运行,但是不能输出我想要的值!哪位大佬出手相救 ...
只看楼主 加入收藏
专业课的小白
Rank: 1
等 级:新手上路
威 望:1
帖 子:56
专家分:0
注 册:2019-12-17
结帖率:40%
收藏
 问题点数:0 回复次数:0 
求教,这有一个程序,可以运行,但是不能输出我想要的值!哪位大佬出手相救!
#include<stdio.h>
void main()
{
    float s;
    int x;
    printf("此程序可以实现大小写的转换\n请输入阿拉伯数字:");
    scanf("%d\n",&s);
    x=s/100000000;
    if(x==0)
    {
        x=s/10000000;
        if(x==0)
        {
            x=s/1000000;
            if(x==0)
            {
                x=s/100000;
                if(x==0)
                {
                    x=s/10000;
                    if(x==0)
                    {
                        x=1000;
                        if(x==0)
                        {
                        x=s/100;
                        if(x==0)
                        {
                            x=s/10;
                            if(x==0)
                            {
                                x=s/1;
                                if(x==0)
                                {printf(" ");}
                                else
                                {
                                    if(x==1)
                                        printf("壹元");
                                    if(x==2)
                                        printf("贰元");
                                    if(x==3)
                                        printf("叁元");
                                    if(x==4)
                                        printf("肆元");
                                    if(x==5)
                                        printf("伍元");
                                    if(x==6)
                                        printf("陆元");
                                    if(x==7)
                                        printf("柒元");
                                    if(x==8)
                                        printf("捌元");
                                    if(x==9)
                                        printf("玖元");
                                }
                            }
                            if(x==1)
                                printf("壹佰");
                            if(x==2)
                                printf("贰佰");
                            if(x==3)
                                printf("叁佰");
                            if(x==4)
                                printf("肆佰");
                            if(x==5)
                                printf("伍佰");
                            if(x==6)
                                printf("陆佰");
                            if(x==7)
                                printf("柒佰");
                            if(x==8)
                                printf("捌佰");
                            if(x==9)
                                printf("玖佰");
                        }
                        else
                        {
                            if(x==1)
                                printf("壹佰");
                            if(x==2)
                                printf("贰佰");
                            if(x==3)
                                printf("叁佰");
                            if(x==4)
                                printf("肆佰");
                            if(x==5)
                                printf("伍佰");
                            if(x==6)
                                printf("陆佰");
                            if(x==7)
                                printf("柒佰");
                            if(x=8)
                                printf("捌佰");
                            if(x==9)
                                printf("玖佰");
                        }
                        }
                        else
                        {
                            if(x==1)
                                printf("壹仟");
                            if(x==2)
                                printf("贰仟");
                            if(x==3)
                                printf("叁仟");
                            if(x==4)
                                printf("肆仟");
                            if(x==5)
                                printf("伍仟");
                            if(x==6)
                                printf("陆仟");
                            if(x==7)
                                printf("柒仟");
                            if(x==8)
                                printf("捌仟");
                            if(x==9)
                                printf("玖仟");
                                 
                        }   
                    }
                    else
                    {
                        if(x==1)
                            printf("壹萬");
                        if(x==2)
                            printf("贰萬");
                        if(x==3)
                            printf("叁萬");
                        if(x==4)
                            printf("肆萬");
                        if(x=5)
                            printf("伍萬");
                        if(x==6)
                            printf("陆萬");
                        if(x==7)
                            printf("柒萬");
                        if(x==8)
                            printf("捌萬");
                        if(x==9)
                            printf("玖萬");
                        
                    }
                }
                else
                {
                    if(x==1)
                        printf("壹拾萬");
                    if(x==2)
                        printf("贰拾萬");
                    if(x==3)
                        printf("叁拾萬");
                    if(x==4)
                        printf("肆拾萬");
                    if(x==5)
                        printf("伍拾萬");
                    if(x==6)
                        printf("陆拾萬");
                    if(x==7)
                        printf("柒拾萬");
                    if(x==8)
                        printf("捌拾萬");
                    if(x==9)
                        printf("玖拾萬");
                    
                }
            }
            else
            {
                if(x==1)
                    printf("壹佰萬");
                if(x==2)
                    printf("贰佰萬");
                if(x==3)
                    printf("叁佰萬");
                if(x==4)
                    printf("肆佰萬");
                if(x==5)
                    printf("伍佰萬");
                if(x==6)
                    printf("陆佰萬");
                if(x==7)
                    printf("柒佰萬");
                if(x==8)
                    printf("捌佰萬");
                if(x==9)
                    printf("玖佰萬");
            }

        }
        else
        {
            if(x==1)
                printf("壹仟萬");
            if(x==2)
                printf("贰仟萬");
            if(x==3)
                printf("叁仟萬");
            if(x==4)
                printf("肆仟萬");
            if(x==5)
                printf("伍仟萬");
            if(x==6)
                printf("陆仟萬");
            if(x==7)
                printf("柒仟萬");
            if(x==8)
                printf("捌仟萬");
            if(x==9)
                printf("玖仟萬");
        }
    }
    else
    {
        if(x==1)
            printf("壹亿");
        if(x==2)
            printf("贰亿");
        if(x==3)
            printf("叁亿");
        if(x==4)
            printf("肆亿");
        if(x==5)
            printf("伍亿");
        if(x==6)
            printf("陆亿");
        if(x==7)
            printf("柒亿");
        if(x==8)
            printf("捌亿");
        if(x==9)
            printf("玖亿");
    }
}
搜索更多相关主题的帖子: 输出 运行 大小写 printf 转换 
2019-12-17 08:32
快速回复:求教,这有一个程序,可以运行,但是不能输出我想要的值!哪位大佬出手 ...
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.019741 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved