| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 328 人关注过本帖
标题:为什么不出结果呢?请教!谢谢
只看楼主 加入收藏
DBSD924
Rank: 1
等 级:新手上路
帖 子:9
专家分:0
注 册:2010-9-25
结帖率:0
收藏
 问题点数:0 回复次数:2 
为什么不出结果呢?请教!谢谢
# include<stdio.h>
void main()
{
long  i;
double b,b1=0,b2=0,b4=0,b6=0,b10=0,other=0;
printf("please input the profits");
scanf("%ld,&i");
b1=10000*0.1;
b2=(20000-10000)*0.075+b1;
b4=(40000-20000)*0.05+b2;
b6=(60000-40000)*0.03+b4;
b10=(100000-60000)*0.015+b6;
other=(i-100000)*0.01+b10;
switch((i-1)/10000)
{
case 0:b=i*0.01;break;
case 1:b=(i-1e5)*0.075+b1;break;
case 2:
case 3:b=(i-2e5)*0.05+b2;break;
case 4:
case 5:b=(i-4e5)*0.03+b4;break;
case 6:
case 7:
case 8:
case 9:b=(i-6e5)*0.015+b6;break;
default:b=other;
}
printf("bonus=%10.2f\n",b);
}
搜索更多相关主题的帖子: 结果 
2010-10-10 20:29
m21wo
Rank: 10Rank: 10Rank: 10
等 级:青峰侠
威 望:4
帖 子:440
专家分:1905
注 册:2010-9-23
收藏
得分:0 
程序代码:
#include<stdio.h>
void main()
{
    long  i;
    double b,b1=0,b2=0,b4=0,b6=0,b10=0,other=0;
    printf("please input the profits");
    scanf("% ld",&i);
    b1=10000*0.1;
    b2=(20000-10000)*0.075+b1;
    b4=(40000-20000)*0.05+b2;
    b6=(60000-40000)*0.03+b4;
    b10=(100000-60000)*0.015+b6;
    other=(i-100000)*0.01+b10;
    switch((i-1)/10000)
    {
    case 0:b=i*0.01;break;
    case 1:b=(i-1e5)*0.075+b1;break;
    case 2:
    case 3:b=(i-2e5)*0.05+b2;break;
    case 4:
    case 5:b=(i-4e5)*0.03+b4;break;
    case 6:
    case 7:
    case 8:
    case 9:b=(i-6e5)*0.015+b6;break;
    default:b=other;
    }
    printf("bonus=%10.2f\n",b);
} 

If You Want Something, Go Get It, Period.
2010-10-10 20:46
m21wo
Rank: 10Rank: 10Rank: 10
等 级:青峰侠
威 望:4
帖 子:440
专家分:1905
注 册:2010-9-23
收藏
得分:0 
程序代码:
# include<stdio.h>
void main()
{
    long  i;
    double b,b1=0,b2=0,b4=0,b6=0,b10=0,other=0;
    printf("please input the profits");
    scanf("%ld",&i);                  //就是这问题
    b1=10000*0.1;
    b2=(20000-10000)*0.075+b1;
    b4=(40000-20000)*0.05+b2;
    b6=(60000-40000)*0.03+b4;
    b10=(100000-60000)*0.015+b6;
    other=(i-100000)*0.01+b10;
    switch((i-1)/10000)
    {
    case 0:b=i*0.01;break;
    case 1:b=(i-1e5)*0.075+b1;break;
    case 2:
    case 3:b=(i-2e5)*0.05+b2;break;
    case 4:
    case 5:b=(i-4e5)*0.03+b4;break;
    case 6:
    case 7:
    case 8:
    case 9:b=(i-6e5)*0.015+b6;break;
    default:b=other;
    }
    printf("bonus=%10.2f\n",b);
} 

If You Want Something, Go Get It, Period.
2010-10-10 20:51
快速回复:为什么不出结果呢?请教!谢谢
数据加载中...
 
   



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

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