Source Code เพื่อ การศึกษา
j0304.java
j0304
// ::: โปรแกรมลำดับที่ 13 // 1. รับตัวเลข 2 จำนวนแล้วนำมาบวกกัน เพื่อแสดงผล // 2. ใช้ BufferedReader ในการรับข้อมูล import java.io.*; class j0304 { public static void main(String args[]) throws IOException { BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in)); String buf; int i1,i2,i3; buf = stdin.readLine(); i1 = Integer.parseInt(buf); buf = stdin.readLine(); i2 = Integer.parseInt(buf); i3 = i1 + i2; System.out.println("Output is "+i1+" + "+i2+" = "+i3); } }
ปรับปรุงโปรแกรม source.pl : 2553-03-20