countpaths.java

来自「《A first book of java》by Gary J.Bronson 」· Java 代码 · 共 25 行

JAVA
25
字号
import java.io.*;   // needed to access input stream classes
public class CountPaths
{
  public static void main(String[] args)
  throws java.io.IOException
  {
    String s1, outMessage;
    int  num;
   
      // set up the basic input stream
      // needed for conversion capabilities  
    InputStreamReader isr = new InputStreamReader(System.in);
      // needed to use ReadLine()
    BufferedReader br = new BufferedReader(isr);
    
    System.out.print("Enter a number: ");
    s1 = br.readLine();  
    num = Integer.parseInt(s1);
    if (num == 5)
      System.out.println("Bingo!");
    else
      System.out.println("Bongo!");
  }
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?