結果
問題 |
No.481 1から10
|
ユーザー |
|
提出日時 | 2018-01-07 11:52:00 |
言語 | Java (openjdk 23) |
結果 |
AC
|
実行時間 | 126 ms / 2,000 ms |
コード長 | 385 bytes |
コンパイル時間 | 3,746 ms |
コンパイル使用メモリ | 75,100 KB |
実行使用メモリ | 41,576 KB |
最終ジャッジ日時 | 2024-12-23 09:56:02 |
合計ジャッジ時間 | 4,993 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 8 |
ソースコード
import java.util.Scanner; import java.util.stream.IntStream; public class No0481 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int sum = IntStream.rangeClosed(1, 10).sum();// 1から10までの合計 int num = sc.nextInt();//書いた数9個の合計 while (sc.hasNext()) { num += sc.nextInt(); } System.out.println(sum - num); } }