码迷,mamicode.com
首页 > 其他好文 > 详细

HW3.5

时间:2016-08-11 00:27:27      阅读:117      评论:0      收藏:0      [点我收藏+]

标签:

技术分享

 

 1 import java.util.Scanner;
 2 
 3 public class Solution
 4 {
 5     public static void main(String[] args)
 6     {
 7         int n1 = (int)(Math.random() * 10);
 8         int n2 = (int)(Math.random() * 10);
 9         int n3 = (int)(Math.random() * 10);
10 
11         Scanner input = new Scanner(System.in);
12         System.out.print(n1 + " + " + n2 + " + " + n3 + " = ? ");
13         int sum = input.nextInt();
14 
15         input.close();
16 
17         if(sum == n1 + n2 + n3)
18             System.out.println("True");
19         else
20             System.out.println("False");
21     }
22 }

 

HW3.5

标签:

原文地址:http://www.cnblogs.com/wood-python/p/5759363.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!