




免费预览已结束,剩余1页可下载查看
下载本文档
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
三角形问题:import java.util.Scanner;public class sanjiaoxing public static void main(String args) System.out.print(Enter 3 integers which are sides of a triangle:n);Scanner input=new Scanner(System.in);double a=input.nextDouble();double b=input.nextDouble();double c=input.nextDouble();System.out.println(side a is:+a+ side b is:+b+ side c is:+c);boolean istriangle=true;if(a+b)=c | (a+c)=b | (c+b)=a)istriangle=false; if(istriangle=false) System.out.print(Not a triangle(不是三角形)); else if(a=b | a=c | b=c) System.out.print(Isosceles(等腰三角形)!); else if(a=b & a=c) System.out.print(Equilateral(等边三角形)); else if(a!=b & a!=c) System.out.print(Sfcalene(一般三角形)); -Nextday问题:import java.util.Scanner;public class nextdaypublic static void main(String args)System.out.print(Enter year/month/day:);Scanner input=new Scanner(System.in);int year=input.nextInt();int month=input.nextInt();int day=input.nextInt();if(year2012)System.out.print(请输入18122012范围内的年份!n);if(1month | month12)System.out.print(请输入112范围内的月份!n);if(1day | day31)System.out.print(请输入131范围内的日期!n);else/System.out.print(year is:+year+ month is:+month+ day is:+day+n);int tomorrowday = day,tomorrowmonth=month,tomorrowyear=year;switch(month)case (1):case (3):case (5):case (7):case (8):case (10):if(day31)tomorrowday=day+1;else tomorrowday=1;tomorrowmonth=month+1;System.out.print(Tomorrows date is:+tomorrowyear+/+tomorrowmonth+/+tomorrowday);break;case 4:case 6:case 9:case 11:if(day30)tomorrowday=day+1;else if(day=30)tomorrowday=1;tomorrowmonth=month+1;else if(day=31)System.out.print(month+月没有31天!);break;System.out.print(Tomorrows date is:+tomorrowyear+/+tomorrowmonth+/+tomorrowday);break;case 12:if(day31)tomorrowday=day+1;else if(day=31)tomorrowday=1;tomorrowmonth=1;tomorrowyear=year+1;System.out.print(Tomorrows date is:+tomorrowyear+/+tomorrowmonth+/+tomorrowday);break;case 2:if(daylocks | locks70)System.out.println(对不起,枪机数不能为负数且厂商限制一个月只能卖出少于70个!);if(1=stocks | locks=80)System.out.println(对不起,枪托数不能为负数且厂商限制一个月只能卖出少于80个!);if(1=barrels | barrels=90)System.out.println(对不起,枪管数不能为负数且厂商限制一个月只能卖出少于90个!);totallocks=totallocks+locks;totalstocks=totalstocks+stocks;totalbarrels=totalbarrels+barrels;System.out.print(Locks sold:+totallocks+nStocks sold:+totalstocks+nbarrels sold:+totalbarrels+n);double locksales=lockprice*totallocks;double stocksales=stockprice*totalstocks;double barrelsales=barrelprice*totalbarrels;double sales=locksales+stocksales+barrelsales;System.out.print(total sales:+sales);if(sales1800) commission=0.10*1000; commission=commission+0.15*800; commission=commission+0.20*(sales-1800);else if(sales1000
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2025年电大专科汉语言文学艺术欣赏试题及答案重点
- 国际贸易实务模拟练习题(附答案)
- 医师定期考核临床模拟练习题及参考答案
- 2025中小学教师入编考试公共基础知识题库与答案
- 2025年《学前教育学》期末测试题及答案
- 2024年湖南公务员考试申论真题及答案
- 标准基础知识培训教材课件
- 2024年院感培训考核试题附答案
- 化验室专业知识培训简讯课件
- 上海某超级豪宅设计方案
- (2025)汽车驾驶员(技师)考试题库及答案
- 股东向公司借款协议书范本(2025版)
- 肌肉骨骼疾病防治课件
- 2025年中国宁夏渔业行业市场前景预测及投资战略研究报告
- 仓库过期物料管理办法
- 信访驻京人员管理办法
- 窗口服务礼仪培训大纲
- 餐饮店品牌授权使用合同范本
- 学堂在线 走进医学 章节测试答案
- 蔬菜温室大棚项目可行性研究报告书书
- 闵行区2024-2025学年下学期七年级数学期末考试试卷及答案(上海新教材沪教版)
评论
0/150
提交评论