c语言noj答案,NOJ答案c++版.docx

NOJ答案c++版.docx

计算AB圆及圆球等的相关计算计算成绩找最大数找幸运数计算ABinclude iostreamusing namespace std;int mainint A,B,c;cinAB;cAB;coutcendl;return 0;圆及圆球等的相关计算include iostreaminclude iomanipusing namespace std;define PI 3.1416int maindouble r,h,l,s,sq,vq,vz;cinrh;l2*PI*r;sPI*r*r;sq4*PI*r*r;vq4*PI*r*r*r/3;vzs*h;coutfixedsetprecision2lendl;coutfixedsetprecision2sendl;coutfixedsetprecision2sqendl;coutfixedsetprecision2vqendl;coutfixedsetprecision2vzendl;return 0;计算成绩include iostreaminclude iomanipusing namespace std;int maindouble a,b,c,A,B;定义数学成绩a,英语成绩b,c语言成绩ccinabc;Aabc;BA/3.0;coutfixedsetprecision6Aendl;coutfixedsetprecision6Bendl;return 0; 找最大数include iostreamusing namespace std;int mainint A,B,C;cinABC;ifAB AC coutAendl;elseifBA BC coutBendl;else coutCendl; return 0;找幸运数include iostreamusing namespace std;int mainint m,n,a,b,c,d,e,f;cinm;am10;bm/1010;cm/10010;dm/100010;em/1000010;ife0 ifd0 ifc0ifb0 ifa0 n0;else na;else na*10b;else na*100b*10c;else na*1000b*100c*10d;else na*10000b*1000c*100d*10e;ifmn coutyesendl;else coutnoendl;return 0;奖金发放include iostreaminclude iomanipusing namespace std;int maindouble w,y;cinw;ifw10 y0.1*w;else ifw20 yw-10*0.0751;else ifw40 yw-20*0.051.75;else ifw60 yw-40*0.032.75;else ifw100 yw-60*0.0153.35;else yw-60*0.013.95;coutfixedsetprecision6yendl;return 0;出租车费难点不足一公里按一公里收费。【ceil函数】法一【“”取余的充分运用】 include iostreaminclude iomanipusing namespace std;int maindouble s,y;int a,b,c;cins;cs; as*10;ba10;ifs2 y7;else ifs15 ifb0 y71.5*s-2;else y71.5*c-1;else ifb0 y26.52.1*s-15;else y26.52.1*c-14;coutfixedsetprecision6yendl;return 0;法二【ceil函数】include iostreaminclude cmathinclude iomanipusing namespace std;int maindouble s,y;int a;cins;aceils;ifs2 y7;else ifs15 y71.5*a-2;else y26.52.1*a-15;coutfixedsetprecision6yendl;return 0;

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值