package zh.codegym.task.task08.task0828;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
/*
月份编号
*/
public class Solution {
public static void main(String[] args) throws IOException {
//在此编写你的代码
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
String m = reader.readLine();
ArrayList<String> list = new ArrayList<String>();
list.add("January");
list.add("February");
list.add("March");
list.add("April");
list.add("May");
list.add("June");
list.add("July");
list.add("Aguest");
list.add("September");
list.add("October");
list.add("November");
list.add("December");
int i = list.indexOf(m)+1;
System.out.println(m+" 是第 "+i+" 个月 ");
}
}
output checking failure
已存档
评论 (5)
- 受欢迎
- 新
- 旧
你必须先登录才能发表评论
Raisenkei
2 六月 2020, 22:21
我觉得你是因为系统判断你没有用到比较主流的办法。
比如说equals,你的思路天马行空,让了涨了见识,
但系统认定你这不标准,也没办法
0
daydreaming
14 四月 2020, 12:41
28行August拼错了。。。。。。
0
rojack
15 四月 2020, 08:51
谢谢,我太蠢了hhh
0
Guadalupe Gagnon
13 四月 2020, 15:57
I don't read mandarin, so i don't know if there are spelling errors else where in this code, but line 28 should be "August". Also there is an extra space at the end of your output line that should not be there.
0
rojack
15 四月 2020, 08:51
thx! I'm so stupid
0