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

p96_3.2

时间:2018-10-17 00:00:03      阅读:196      评论:0      收藏:0      [点我收藏+]

标签:stat   nbsp   str   input   tin   string   []   port   public   

 1 import java.util.Scanner;
 2 public class AdditionQuiz {
 3     public static void main(String[] args){
 4         int number1 = (int)(System.currentTimeMillis()%10);
 5         int number2 = (int)(System.currentTimeMillis()/10%10);
 6         int number3 = (int)(System.currentTimeMillis()/100%10);
 7         Scanner input = new Scanner(System.in);
 8         System.out.println("What is " + number1 + " + " + number2 + " + " + number3 + "?");
 9         int answer = input.nextInt();
10         System.out.println(number1 + " + " + number2 + " + " + number3 + " = " + answer + " is " + (number1+number2+number3 == answer));
11     }
12 }

 

p96_3.2

标签:stat   nbsp   str   input   tin   string   []   port   public   

原文地址:https://www.cnblogs.com/cherrydream/p/9800901.html

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