判断考试成绩等级。

L BELIEVE L 2019-03-12 12:22:01
import java.util.Scanner; public class Test1 { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); System.out.println("请输入分数:"); double score = scanner.nextDouble(); scanner.close(); if (score < 0 || score > 100) { System.out.println("输入的分数不在0-100之间,不符合要求"); } else if (score >= 90) { System.out.println("A"); } else if (score >= 80) { System.out.println("B"); } else if (score >= 60) { System.out.println("C"); } else { System.out.println("D"); } } }
...全文
424 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
L BELIEVE L 2019-03-12
  • 打赏
  • 举报
回复
publicclassTest{ //输入年份判断是否为闰年  publicstaticvoidmain(String[]args){  intyear;  System.out.println("请输入年份:");  Scannersc=newScanner(System.in);  year=sc.nextInt();  if(year%4==0&&year%100!=0||year%400==0){  System.out.println("是闰年");  }else{  System.out.println("不是闰年");  }  }  }
丰云 2019-03-12
  • 打赏
  • 举报
回复
java跟javascript傻傻分不清。。。。

87,993

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧