推扬网

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
推扬网 门户 你问我答 查看内容

张馨茹:C语言中switch语句用法(做题)!谢谢!

2020-8-10 19:52| 发布者: admin| 查看: 54| 评论: 0

摘要: 夜澜听雨的回答: Float machine(float money)switch(money) { case (money200) :return money; case (money=200money500) :return (0.9*money); case (money=500money1000) :renturn (0.8*money); case (money=100 ...

夜澜听雨的回答:

Float machine(float money)switch(money) { case (money<200) :return money; case (money>=200&&money<500) :return (0.9*money); case (money>=500&&money<1000) :renturn (0.8*money); case (money>=1000) :renturn (0.75*money); default :return 0; } return 0; }

夜澜听雨的回答:

Float machine(float money)switch(money) { case (money<200) :return money; case (money>=200&&money<500) :return (0.9*money); case (money>=500&&money<1000) :renturn (0.8*money); case (money>=1000) :renturn (0.75*money); default :return 0; } return 0; }

QYBI奇比的回答:

你好,这些问题很好解决,常客网里面全部都有的

Poplar的回答:

switch( money / 100 )

{

    case 0:

    case 1:

        return money;

    case 2:

    case 3:

    case 4:

        return money * 0.9;

    case 5:

    case 6:

    case 7:

    case 8:

    case 9:

        return mondy * 0.8;

    default:

        return mondy * 0.75;

}


鲜花

握手

雷人

路过

鸡蛋

最新评论

热门推荐
最新资讯

广告服务|投稿要求|禁言标准|版权说明|免责声明|手机版|小黑屋|推扬网 ( 粤ICP备18134897号 )|网站地图 | 邮箱:vayae@hotmail.com

GMT+8, 2025-5-1 17:11 , Processed in 0.060886 second(s), 29 queries .

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

返回顶部