說明:不使用條件式,只用運算子。
import java.util.Scanner;
public class D068 {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int w = Integer.parseInt(in.nextLine());
System.out.println(w - w / 51);
}
}
Python 版 (2022.07)w = int(input())
print(w - (w // 51))
沒有留言:
張貼留言