eroupean company's needs bonAppletit

/**
	 * bonAppletit
	 * 
	 * output
	 * overcharge
	 * number items:
	 * investigation volummn - Anna bill cost
	 * print "Anna was overcharged"
	 * 
	 * or not overcharge
	 * output: bonAppletit
	 * 
	 * eroupean company's  needs
	 * constriants:
	 * bill numSize: 2<=n<=10to5
	 * keyIndex: that Anna did not eat : 0<=k<n
	 * bill index of that order items cost: 0<=bill[i]<=10to4
	 * the amount of money that Bon chareged: 0<=b<=sum(bill[0],bill[n-1]) bill[i] is in this encloure
	 *
	 * @param bill
	 * @param k
	 * @param b
	 */
	public static void bonAppletit(List<Integer> bill,int k,int b) {
		if(bill==null) {
			return ;
		}
		if(bill.isEmpty()) {
			return ;
		}
		int intVal=1;
		for (int i = 0; i < 5; i++) {
			intVal*=10;
		}
		if(bill.size()<2 || bill.size()>intVal) {
			return ;
		}
		if(k<0 || k>=bill.size()) {
			return ;
		}
		int intVal1=1;
		for (int i = 0; i < 4; i++) {
			intVal1*=10;
		}
		for(Integer intTempItem : bill) {
			if(intTempItem<0 || intTempItem>intVal1) {
				return ;
			}
		}
		int sumE=0;
		for(Integer elementBillItem : bill) {
			sumE+=elementBillItem;
		}
		if(b<0 || b>sumE) {
			return ;
		}
		int itemBillSumEvitIndexItem=0;
		Integer integer = bill.get(k);
		for(Integer itemBill : bill) {
			if(itemBill==integer) {
				continue;
			}
			itemBillSumEvitIndexItem+=itemBill;
		}
		int averageCharge = itemBillSumEvitIndexItem/2;
		if(b>averageCharge) {
			System.out.println("Anna was overcharged");
		}else if(b==averageCharge){
			System.out.println("bonAppletit");
		}
		return ;
	}

#牛客AI配图神器#

#夸夸我的求职搭子##三一重工求职进展汇总##牛客创作赏金赛##硬件应届生薪资是否普遍偏低?##材料人,你们签了哪个公司#
Java技术 文章被收录于专栏

JavaEE技术 编程开发经验 企业通用技术

全部评论

相关推荐

Jcwemz:中软证书写单行,考了什么学了什么相关技术栈的内容就说自己会什么, 没实习就包装实习简历,将项目经历写成实习做的,项目时间拉长,项目成果具体化,测试的项目成果无非就是写了多少用例查出了多少bug,重要的不是实习了多久,而是你会多少东西,你能表达的就都是你的。 cet4,随便找个地方标上就好了,不用写单行。 粗略建议,我也不在行,觉得对的可以采纳
实习,投递多份简历没人回...
点赞 评论 收藏
分享
专业嗎喽:个人信息名字太大,合到电话邮箱那一栏就行,有党员写过党,剩下其他全删,站空太大了 把实习经历丰富,放最前面,然后是个人评价,技能之类的,然后是学校信息。项目经历最后面,可以就选一个自己擅长的。 现在是学校不是92就扣分的,没必要放前面。 然后现在看重实习经历>竞赛经历(校园经历)>课程项目经历
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务