package com.shrimpking.t1;
import java.util.Random;
import java.util.Scanner;
/**
* Created by IntelliJ IDEA.
*
* @Author : Shrimpking
* @create 2024/12/17 21:11
*/
public class GuessNumber
{
public static void main(String[] args)
{
Scanner in = new Scanner(System.in);
System.out.println("I am thinking of a number between 1 and 100(including both).");
System.out.println("Can you guess what it is?");
System.out.print("Type a number:");
int a = in.nextInt();
System.out.println("Your guess is:" + a);
Random random = new Random();
int b = random.nextInt(100) + 1;
System.out.println("the number i was thinking of is:" + b);
int c = Math.abs(b-a);
System.out.println("You were off by:" + c);
}
}