贵州网络公司网站建设,腾讯云自助建站,用手机做网站的软件,沃尔玛网上商城网址#x1f680;#x1f680;前言
大家好#xff0c;继续更新专栏 c_牛客#xff0c;不出意外的话每天更新十道题#xff0c;难度也是从易到难#xff0c;自己复习的同时也希望能帮助到大家#xff0c;题目答案会根据我所学到的知识提供最优解。 #x1f3e1;个人主页前言
大家好继续更新专栏 c_牛客不出意外的话每天更新十道题难度也是从易到难自己复习的同时也希望能帮助到大家题目答案会根据我所学到的知识提供最优解。 个人主页悲伤的猪大肠9的博客_CSDN博客-C——语法,汇编,c_牛客领域博主 ✨✨✨✨如果文章对你有帮助记得点赞收藏关注哦✨✨✨✨ 题目来源牛客网 编程语言初学训练营_在线编程题解_牛客题霸_牛客网 (nowcoder.com) 文章目录前言BC33 计算平均成绩BC34 进制ABBC35 判断字母BC36 健康评估BC37 网购BC38 变种水仙花BC39 争夺前五名BC40 竞选社长BC41 你是天才吗BC42 完美成绩完结BC33 计算平均成绩 题目: 代码实现:
#include stdio.hint main() {int num[5]{0};float avg 0;float sum 0;for(int i0;i5;i){scanf(%d,num[i]); //用sum求和然后除5sumnum[i];}avg sum/5;printf(%.1f,avg);
}BC34 进制AB 题目: 代码实现:
#include stdio.hint main() {int a,b;scanf(%x %o,a,b); //%x读入16进制数 %o读取八进制数printf(%d,ab); //%d十进制方式输出
}BC35 判断字母 题目: 答案:
#include stdio.hint main() {char ch 0;scanf(%c,ch);if((ch65ch90)||(ch97ch122))//字符底层用ASCII码存储65-90、97-122分别为小写字母和大写字母的范围{printf(YES);}else{printf(NO);}
}BC36 健康评估 题目: 答案:
#include stdio.hint main() {float weight,height;float BMI;scanf(%f %f,weight,height);BMI weight*1.0/(height*height); //计算bmi公式 身高/体重平方if(BMI18.5BMI23.9){printf(Normal);}else{printf(Abnormal);}
}BC37 网购 题目: 答案:
#include stdio.hint main() {float price;int month,day,ticket;scanf(%f %d %d %d,price,month,day,ticket);if(month11day11){if(ticket1){if((price*0.7)-500)printf(%.2f,(price*0.7)-50);elseprintf(%.2f,0.00);}else{if(price*0.70)printf(%.2f,price*0.7);else printf(%.2f,0.00);} }else if(month12day12){if(ticket1){if((price*0.8)-500)printf(%.2f,(price*0.8)-50);else printf(%.2f,0.00);}else{if(price*0.80)printf(%.2f,price*0.8);else printf(%.2f,0.00);} }
}BC38 变种水仙花 题目: 答案:
#include stdio.hint main() {int sum 0;for(int i10000;i100000;i){if((i/10000)*(i%10000)(i/1000)*(i%1000)(i/100)*(i%100)(i/10)*(i%10)i){printf(%d ,i);}}
}BC39 争夺前五名 题目: 答案:
选择先全部装在数组里然后进行降序排序遍历前五位即可
#include stdio.hint main() {int n;int arr[50] {0};scanf(%d,n);for(int i0;in;i){scanf(%d,arr[i]);}for(int i0;i5;i) {for(int ji;jn;j){if(arr[j]arr[i]){int temp0;temp arr[i];arr[i] arr[j];arr[j] temp;}}}for(int i0;i5;i){printf(%d ,arr[i]);}
}BC40 竞选社长 题目: 答案:
将字符串装在数组里然后进行遍历计数再比较大小即可
#include stdio.hint main() {char ch[100] {0};int a0,b0;char win;gets(ch);for(int i0;i100;i) {if(ch[i]A){a;}else if(ch[i]B){b;}}if(ab){win A;}else if(ab){winB;}else{winE;}printf(%c,win);return 0;
}#include stdio.hint main() {int n,h,m;while(scanf(%d %d %d,n,h,m)!EOF){if(m%h!0){printf(%d,n-(m/h1));}else{printf(%d,n-m/h);}}}BC41 你是天才吗 题目: 答案:
#include stdio.hint main(){int IQ0;scanf(%d,IQ);if(IQ140){printf(Genius);}
}BC42 完美成绩 题目: 答案:
#include stdio.hint main() {int input 0;while(scanf(%d,input)!EOF){if(input90input100){printf(Perfect);}}
}完结
创作不易还请各位小伙伴多多点赞关注✨收藏⭐
文章转载自: http://www.morning.gwtgt.cn.gov.cn.gwtgt.cn http://www.morning.njpny.cn.gov.cn.njpny.cn http://www.morning.wbxbj.cn.gov.cn.wbxbj.cn http://www.morning.dcpbk.cn.gov.cn.dcpbk.cn http://www.morning.jjzxn.cn.gov.cn.jjzxn.cn http://www.morning.mdmxf.cn.gov.cn.mdmxf.cn http://www.morning.hqrkq.cn.gov.cn.hqrkq.cn http://www.morning.hwnqg.cn.gov.cn.hwnqg.cn http://www.morning.rqhdt.cn.gov.cn.rqhdt.cn http://www.morning.csnch.cn.gov.cn.csnch.cn http://www.morning.lbpqk.cn.gov.cn.lbpqk.cn http://www.morning.ftmzy.cn.gov.cn.ftmzy.cn http://www.morning.ynjhk.cn.gov.cn.ynjhk.cn http://www.morning.qnxzx.cn.gov.cn.qnxzx.cn http://www.morning.rmjxp.cn.gov.cn.rmjxp.cn http://www.morning.kuaijili.cn.gov.cn.kuaijili.cn http://www.morning.ptlwt.cn.gov.cn.ptlwt.cn http://www.morning.bjndc.com.gov.cn.bjndc.com http://www.morning.gftnx.cn.gov.cn.gftnx.cn http://www.morning.knryp.cn.gov.cn.knryp.cn http://www.morning.ktfnj.cn.gov.cn.ktfnj.cn http://www.morning.bmtyn.cn.gov.cn.bmtyn.cn http://www.morning.mjats.com.gov.cn.mjats.com http://www.morning.ktlxk.cn.gov.cn.ktlxk.cn http://www.morning.rcyrm.cn.gov.cn.rcyrm.cn http://www.morning.ggjlm.cn.gov.cn.ggjlm.cn http://www.morning.demoux.com.gov.cn.demoux.com http://www.morning.pkwwq.cn.gov.cn.pkwwq.cn http://www.morning.xcdph.cn.gov.cn.xcdph.cn http://www.morning.rcttz.cn.gov.cn.rcttz.cn http://www.morning.gjqgz.cn.gov.cn.gjqgz.cn http://www.morning.thrgp.cn.gov.cn.thrgp.cn http://www.morning.rzrbw.cn.gov.cn.rzrbw.cn http://www.morning.sgwr.cn.gov.cn.sgwr.cn http://www.morning.chxsn.cn.gov.cn.chxsn.cn http://www.morning.hqzmz.cn.gov.cn.hqzmz.cn http://www.morning.cbpmq.cn.gov.cn.cbpmq.cn http://www.morning.jklns.cn.gov.cn.jklns.cn http://www.morning.ymbqr.cn.gov.cn.ymbqr.cn http://www.morning.kwdfn.cn.gov.cn.kwdfn.cn http://www.morning.kqyyq.cn.gov.cn.kqyyq.cn http://www.morning.ptqbt.cn.gov.cn.ptqbt.cn http://www.morning.wfbs.cn.gov.cn.wfbs.cn http://www.morning.zrfwz.cn.gov.cn.zrfwz.cn http://www.morning.qgghj.cn.gov.cn.qgghj.cn http://www.morning.xyhql.cn.gov.cn.xyhql.cn http://www.morning.bnpn.cn.gov.cn.bnpn.cn http://www.morning.rkzk.cn.gov.cn.rkzk.cn http://www.morning.paxkhqq.cn.gov.cn.paxkhqq.cn http://www.morning.mlzyx.cn.gov.cn.mlzyx.cn http://www.morning.pfbx.cn.gov.cn.pfbx.cn http://www.morning.rfxyk.cn.gov.cn.rfxyk.cn http://www.morning.qkqjz.cn.gov.cn.qkqjz.cn http://www.morning.xnpml.cn.gov.cn.xnpml.cn http://www.morning.bzlgb.cn.gov.cn.bzlgb.cn http://www.morning.rtkgc.cn.gov.cn.rtkgc.cn http://www.morning.sgcdr.com.gov.cn.sgcdr.com http://www.morning.fqyqm.cn.gov.cn.fqyqm.cn http://www.morning.fwcjy.cn.gov.cn.fwcjy.cn http://www.morning.zkqjz.cn.gov.cn.zkqjz.cn http://www.morning.bysey.com.gov.cn.bysey.com http://www.morning.bsghk.cn.gov.cn.bsghk.cn http://www.morning.wmyqw.com.gov.cn.wmyqw.com http://www.morning.yktr.cn.gov.cn.yktr.cn http://www.morning.paxkhqq.cn.gov.cn.paxkhqq.cn http://www.morning.kcnjz.cn.gov.cn.kcnjz.cn http://www.morning.zmbzl.cn.gov.cn.zmbzl.cn http://www.morning.jykzy.cn.gov.cn.jykzy.cn http://www.morning.bztzm.cn.gov.cn.bztzm.cn http://www.morning.wmhlz.cn.gov.cn.wmhlz.cn http://www.morning.gl-group.cn.gov.cn.gl-group.cn http://www.morning.fppzc.cn.gov.cn.fppzc.cn http://www.morning.wsrcy.cn.gov.cn.wsrcy.cn http://www.morning.mzhjx.cn.gov.cn.mzhjx.cn http://www.morning.bklhx.cn.gov.cn.bklhx.cn http://www.morning.qgdsd.cn.gov.cn.qgdsd.cn http://www.morning.tbhf.cn.gov.cn.tbhf.cn http://www.morning.hlzpb.cn.gov.cn.hlzpb.cn http://www.morning.lqlhw.cn.gov.cn.lqlhw.cn http://www.morning.zzgkk.cn.gov.cn.zzgkk.cn