import java.util.Scanner;

 public class Solution
 {
     public static void main(String[] args)
     {
         Scanner input = new Scanner(System.in);

         int number1 = (int)(Math.random() * 100);
         int number2 = (int)(Math.random() * 100);

         System.out.print(number1 + " + " + number2 + " = ? ");
         int sum = input.nextInt();

         input.close();

         if(sum == number1 + number2)
             System.out.println("True");
         else
             System.out.println("False");
     }
 }

HW3.4的更多相关文章

  1. HW3 纠结的心得

    改好的controller //yuec2 Yue Cheng package hw3; import java.io.File; import java.text.DecimalFormat; im ...

  2. 基于卷积神经网络的面部表情识别(Pytorch实现)----台大李宏毅机器学习作业3(HW3)

    一.项目说明 给定数据集train.csv,要求使用卷积神经网络CNN,根据每个样本的面部图片判断出其表情.在本项目中,表情共分7类,分别为:(0)生气,(1)厌恶,(2)恐惧,(3)高兴,(4)难过 ...

  3. Software Testing hw3

    (a):可绘制出如下图所示的流程图 (b):对于测试用例t1=(n=3)和t2=(n=5),MAXPRIMES = 4时,t1不能检查出错误,而t2则会发生数组越界错. (c):要使测试路径不通过wh ...

  4. HW3.29

    import java.util.Scanner; public class Solution { public static void main(String[] args) { Scanner i ...

  5. HW3.28

    import java.util.Scanner; public class Solution { public static void main(String[] args) { Scanner i ...

  6. HW3.27

    import java.util.Scanner; public class Solution { public static void main(String[] args) { Scanner i ...

  7. HW3.26

    import java.util.Scanner; public class Solution { public static void main(String[] args) { Scanner i ...

  8. HW3.25

    import java.util.Scanner; public class Solution { public static void main(String[] args) { Scanner i ...

  9. HW3.24

    public class Solution { public static void main(String[] args) { int number = (int)(Math.random() * ...

  10. HW3.23

    import java.util.Scanner; public class Solution { public static void main(String[] args) { Scanner i ...

随机推荐

  1. 谈谈GUI的配色和字体选择

    对于工控领域的显示屏,显示效果很难和电脑屏幕相比.电脑上操作系统或者各种软件的配色方案,在应用到工业控制屏上就会出现“完全不是所想要”的结果,所以工控领域GUI的色彩.字体的选择还是有特别的讲究. 配 ...

  2. unity3d游戏开发——新手引导

    GUI实现,如下: 按“G”键开始新手引导 代码如下: using UnityEngine; using System.Collections; public class OkButton : GUI ...

  3. 安全测试常见的10个问题 ZT

    1, 问题:没有被验证的输入     测试方法:     数据类型(字符串,整型,实数,等)    允许的字符集    最小和最大的长度    是否允许空输入    参数是否是必须的    重复是否允 ...

  4. linux运维面试题

    一.有文件file1 1.查询file1 里面空行的所在行号 grep -n "^#" file1 or awk ‗{if($0~/^$/)print NR}‘ file or g ...

  5. Java中的数组问题

    java.util.Arrays  This class deals with 'real' arrays in java, in the form of T[]. Thus it doesn't d ...

  6. Error format not a string literal and no format arguments解决方案

    原地址: http://blog.csdn.net/joeblackzqq/article/details/25985299 cData.cpp:355:30:error:format not a s ...

  7. Python 全栈开发 -- 开发环境篇

    开发环境是一个文本编辑器和 Python 解释器的组合.文本编辑器用来写代码,解释器提供了一种方法来运行编写的代码.一个文本编辑器可以像 Windows 上的 Notepad 一样简单,或是一个复杂的 ...

  8. cat命令常用的13个技巧

    在Linux系统中,大多数配置文件.日志文件,甚至shell脚本都使用文本文件格式,因此,Linux系统存在着多种文本编辑器,但当你仅仅想要查看一下这些文件的内容时,可使用一个简单的命令-cat. c ...

  9. 页面上动态编译及执行java代码

    本文地址:http://www.cnblogs.com/liaoyu/p/real-time-compile-and-run-java-code-web-app.html 最近看到同事在页面上编译和执 ...

  10. html5 动画精灵

    <!DOCTYPE HTML> <html lang="en-US"> <head> <meta charset="UTF-8& ...