2009年3月9日 星期一

Lab Scanner

enter

------------------------------------------------<程式碼開始>--------------------------------------

import java.awt.*;
import java.applet.*;
import javax.swing.*;
import java.util.Scanner;
public class S9526215 extends JApplet {
public static void main( String[] args )
{
Scanner Keyboard = new Scanner(System.in);
System.out.println("Enter two number to add");
int number1 = Keyboard.nextInt();
int number2 = Keyboard.nextInt();
int number3 = number1 + number2;
System.out.println(number1 + "+" + number2 + "=" + number3);
}
}


------------------------------------------------<程式碼結束>--------------------------------------

沒有留言:

張貼留言