【初心者】Java質問・相談スレッド113【大歓迎】
at TECH
185:デフォルトの名無しさん
08/03/05 22:26:53
// >>181
public static void main(String[] args) throws IOException {
// 標準入力ストリームから行単位で読み込めるようにBufferedReaderクラスのインスタンスを生成
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
System.out.print(a: );
// 標準入力から1行読み込みint型に変換
int a = Integer.parseInt(br.readLine());
System.out.print(b: );
int b = Integer.parseInt(br.readLine());
System.out.println(a + b);
}
次ページ続きを表示1を表示最新レス表示スレッドの検索類似スレ一覧話題のニュースおまかせリスト▼オプションを表示暇つぶし2ch
4901日前に更新/246 KB
担当:undef