编程题:19
import java.util.Scanner;

public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int n = scanner.nextInt();
boolean found = false;
for (int y = 0; y < 100; y++) {
for (int f = 0; f < 100; f++) {
if (100 * f + y - n == 200 * y + 2 * f) {
System.out.printf("%d.%d\n", y, f);
found = true;
break;
}
}
if (found) {
break;
}
}
if (!found) {
System.out.println("No Solution");
}
}
}

posted on 2025-05-12 23:23  Swishy  阅读(4)  评论(0)    收藏  举报