62,614
社区成员
发帖
与我相关
我的任务
分享
public static void main(String[] args) throws Exception {
System.out.print("输入运行次数: ");
BufferedReader bufferRead = new BufferedReader(new InputStreamReader(System.in));
int count = Integer.parseInt(bufferRead.readLine());
while (count > 0){
System.out.print("输入一个整数days(>=0): ");
int days = Integer.parseInt(bufferRead.readLine());
int oddDays = days % 7;
int addDays = oddDays + 5;
if(addDays > 6){
System.out.println("计算结果:" + (addDays - 6));
}else{
System.out.println("计算结果:" + addDays);
}
count --;
}
}