Tech Module -Data Types and Variables - Exercise - Poke Mon
Здравейте, може ли някой да ми каже защо judge ми дава само 80% ?
https://pastebin.com/63jYLaYc
https://judge.softuni.bg/Contests/Practice/Index/1228#9
Здравейте, може ли някой да ми каже защо judge ми дава само 80% ?
https://pastebin.com/63jYLaYc
https://judge.softuni.bg/Contests/Practice/Index/1228#9
Понеже в проверката дали N e станало 50% всъщност проверяваш М :)
import java.util.Scanner;
public class Pokemon {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int N = Integer.parseInt(scanner.nextLine());
int M = Integer.parseInt(scanner.nextLine());
int Y = Integer.parseInt(scanner.nextLine());
int count = 0;
double NHalf = N/2.0;
while(N >= M){
N -= M;
count++;
if (N == NHalf && Y > 0){
N /= Y;
}
}
System.out.println(N);
System.out.println(count);
}
}