题解 | #四季#

四季

http://www.nowcoder.com/practice/eaf21203b61b4a689987fdc165d00dfc

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Main{
    public static void main(String[] args) throws IOException{
        BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
        String str = bf.readLine().substring(4,6);
        int month = Integer.parseInt(str);
        if(month>=3 && month<=5){
            System.out.println("spring");
        }
        else if(month>=6 && month<=8 ){
            System.out.println("summer");
        }
        else if(month>=9 && month<=11){
            System.out.println("autumn");
        }
        else{
            System.out.println("winter");
        }
    }
}
全部评论

相关推荐

迷茫的大四🐶:摊牌了,我是25届的,你们也不招我
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务