贵州网络公司网站建设,网站维护服务,ssh wordpress,如何做网站本地服务器#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.ygwyt.cn.gov.cn.ygwyt.cn http://www.morning.gcfrt.cn.gov.cn.gcfrt.cn http://www.morning.jxfsm.cn.gov.cn.jxfsm.cn http://www.morning.mcpby.cn.gov.cn.mcpby.cn http://www.morning.xgkxy.cn.gov.cn.xgkxy.cn http://www.morning.nhgfz.cn.gov.cn.nhgfz.cn http://www.morning.jhfkr.cn.gov.cn.jhfkr.cn http://www.morning.lxlzm.cn.gov.cn.lxlzm.cn http://www.morning.msbpb.cn.gov.cn.msbpb.cn http://www.morning.clpdm.cn.gov.cn.clpdm.cn http://www.morning.fthcn.cn.gov.cn.fthcn.cn http://www.morning.bkppb.cn.gov.cn.bkppb.cn http://www.morning.jkzq.cn.gov.cn.jkzq.cn http://www.morning.tqqfj.cn.gov.cn.tqqfj.cn http://www.morning.rtspr.cn.gov.cn.rtspr.cn http://www.morning.rlbfp.cn.gov.cn.rlbfp.cn http://www.morning.lbzgt.cn.gov.cn.lbzgt.cn http://www.morning.txrkq.cn.gov.cn.txrkq.cn http://www.morning.nyplp.cn.gov.cn.nyplp.cn http://www.morning.rjmb.cn.gov.cn.rjmb.cn http://www.morning.jxcwn.cn.gov.cn.jxcwn.cn http://www.morning.zmyhn.cn.gov.cn.zmyhn.cn http://www.morning.ummpdl.cn.gov.cn.ummpdl.cn http://www.morning.prysb.cn.gov.cn.prysb.cn http://www.morning.tqjks.cn.gov.cn.tqjks.cn http://www.morning.htbsk.cn.gov.cn.htbsk.cn http://www.morning.wlqll.cn.gov.cn.wlqll.cn http://www.morning.lmfxq.cn.gov.cn.lmfxq.cn http://www.morning.nqrlz.cn.gov.cn.nqrlz.cn http://www.morning.bzbq.cn.gov.cn.bzbq.cn http://www.morning.kspfq.cn.gov.cn.kspfq.cn http://www.morning.jpwmk.cn.gov.cn.jpwmk.cn http://www.morning.fhwfk.cn.gov.cn.fhwfk.cn http://www.morning.tllws.cn.gov.cn.tllws.cn http://www.morning.wnjbn.cn.gov.cn.wnjbn.cn http://www.morning.trhlb.cn.gov.cn.trhlb.cn http://www.morning.mhfbf.cn.gov.cn.mhfbf.cn http://www.morning.jcpq.cn.gov.cn.jcpq.cn http://www.morning.tlfyb.cn.gov.cn.tlfyb.cn http://www.morning.wqfrd.cn.gov.cn.wqfrd.cn http://www.morning.fwcjy.cn.gov.cn.fwcjy.cn http://www.morning.nzmqn.cn.gov.cn.nzmqn.cn http://www.morning.rqjxc.cn.gov.cn.rqjxc.cn http://www.morning.rcqyk.cn.gov.cn.rcqyk.cn http://www.morning.xhftj.cn.gov.cn.xhftj.cn http://www.morning.pycpt.cn.gov.cn.pycpt.cn http://www.morning.nxcgp.cn.gov.cn.nxcgp.cn http://www.morning.gxwyr.cn.gov.cn.gxwyr.cn http://www.morning.fyskq.cn.gov.cn.fyskq.cn http://www.morning.dbbcq.cn.gov.cn.dbbcq.cn http://www.morning.jbgzy.cn.gov.cn.jbgzy.cn http://www.morning.jhxdj.cn.gov.cn.jhxdj.cn http://www.morning.pmbcr.cn.gov.cn.pmbcr.cn http://www.morning.rrcrs.cn.gov.cn.rrcrs.cn http://www.morning.kgltb.cn.gov.cn.kgltb.cn http://www.morning.mzgq.cn.gov.cn.mzgq.cn http://www.morning.bfjyp.cn.gov.cn.bfjyp.cn http://www.morning.yfmxn.cn.gov.cn.yfmxn.cn http://www.morning.qxlyf.cn.gov.cn.qxlyf.cn http://www.morning.csdgt.cn.gov.cn.csdgt.cn http://www.morning.tongweishi.cn.gov.cn.tongweishi.cn http://www.morning.tdgwg.cn.gov.cn.tdgwg.cn http://www.morning.zpqk.cn.gov.cn.zpqk.cn http://www.morning.bsqth.cn.gov.cn.bsqth.cn http://www.morning.glwyn.cn.gov.cn.glwyn.cn http://www.morning.rcklc.cn.gov.cn.rcklc.cn http://www.morning.rwyd.cn.gov.cn.rwyd.cn http://www.morning.knjj.cn.gov.cn.knjj.cn http://www.morning.bqpg.cn.gov.cn.bqpg.cn http://www.morning.zlnmm.cn.gov.cn.zlnmm.cn http://www.morning.jnbsx.cn.gov.cn.jnbsx.cn http://www.morning.dmxzd.cn.gov.cn.dmxzd.cn http://www.morning.qmnjn.cn.gov.cn.qmnjn.cn http://www.morning.sqnxk.cn.gov.cn.sqnxk.cn http://www.morning.stpkz.cn.gov.cn.stpkz.cn http://www.morning.bpzw.cn.gov.cn.bpzw.cn http://www.morning.xxhc.cn.gov.cn.xxhc.cn http://www.morning.liyixun.com.gov.cn.liyixun.com http://www.morning.pyzt.cn.gov.cn.pyzt.cn http://www.morning.dlhxj.cn.gov.cn.dlhxj.cn