文章
7
粉丝
56
获赞
0
访问
3.8k
Java解法,用屁股写也行
import java.util.Scanner;
public class Main{
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
while(in.hasNextLine()){
int curNum = Integer.parseInt(in.nextLine());
if(curNum % 2 == 1) System.out.println("odd number");
else System.out.println("even number");
}
}
}
登录后发布评论
暂无评论,来抢沙发