package nowcoder; import java.util.Scanner; public class Demo1 {     public static void main(String[] args) {         // 判断一个年份是不是闰年         String a = "是闰年";         String b = "是平年";         Scanner input = new Scanner(System.in);// 创建输入流         System.out.println("请输入一个年份:");         int year = input.nextInt();         // 运用三目运算符判断         System.out.println(((year % 4 == 0 && year % 100 != 0) || year % 400 == 0) ? a : b);         input.close();// 关闭输入流     } }
点赞 评论

相关推荐

牛客98820962...:个人意见,我觉得实习和项目经历要一致,达美乐感觉没必要写
点赞 评论 收藏
分享
牛客网
牛客网在线编程
牛客网题解
牛客企业服务