結果

問題 No.481 1から10
ユーザー yamax3232
提出日時 2017-02-13 20:57:27
言語 Java
(openjdk 23)
結果
AC  
実行時間 143 ms / 2,000 ms
コード長 807 bytes
コンパイル時間 3,998 ms
コンパイル使用メモリ 77,100 KB
実行使用メモリ 41,560 KB
最終ジャッジ日時 2024-12-29 19:09:44
合計ジャッジ時間 5,802 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 8
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;
public class OneToTen {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		int a[]={0,0,0,0,0,0,0,0,0,0};
		int count[]={0,0,0,0,0,0,0,0,0,0};
		Scanner kb=new Scanner(System.in);
		for(int i=0;i<9;i++){
			a[i]=kb.nextInt();
		}

		for(int i=0;i<10;i++){
			switch(a[i]){			
			case 1:count[0]++;
			continue;
			case 2:count[1]++;continue;
			case 3:count[2]++;continue;
			case 4:count[3]++;continue;
			case 5:count[4]++;continue;
			case 6:count[5]++;continue;
			case 7:count[6]++;continue;
			case 8:count[7]++;continue;
			case 9:count[8]++;continue;
			case 10:count[9]++;continue;
			default:continue;
			}

		}
		for(int i=0;i<10;i++){
			if(count[i]==0){
				System.out.printf("%d\n",i+1);
			}
		}
		kb.close();
	}

}
0