- 【初心者歓迎】C/C++室 Ver.93【環境依存OK】
637 :デフォルトの名無しさん[]:2014/11/15(土) 14:54:52.30 ID:g+QiKrjA - これをCに訳してもらえませんか?
月名を入力すると数字の月を出力する 数字を入力すると月名を出力する List<String> NAMES = Arrays.asList("jan","feb","mar","apr","may","jun","jul","aug","sep","oct","nov","dec"); Scanner sc = new Scanner(System.in); while(true) System.out.println( sc.hasNextInt()? NAMES.get(sc.nextInt()-1): NAMES.indexOf(sc.next())+1 );
|