Summer Outfit - задача - проблем в Judge
Здравейте, аз по същия начин я написах, но в джъджа ми дава 80/100 ? Каде е грешката ми не разбирам.
Първо я направих със Switch, същатата работа, после го замених с иф елсове и пак 80/100...
package com.company;
import java.util.Scanner;
public class SummerOutFit {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int degree = Integer.parseInt(scan.nextLine());
String fit = scan.nextLine().toLowerCase();
String outfit = "";
String shoes = "";
if ("morning".equals(fit)) {
if (degree >= 10 && degree <= 18) {
outfit = "Sweatshirt";
shoes = "Sneakers";
System.out.printf("It's %d degrees, get your %s and %s.", degree, outfit, shoes);
} else if (degree > 18 && degree <= 24) {
outfit = "Shirt";
shoes = "Moccasins";
System.out.printf("It's %d degrees, get your %s and %s.", degree, outfit, shoes);
} else if (degree > 25) {
outfit = "T-Shirt";
shoes = "Sandals";
System.out.printf("It's %d degrees, get your %s and %s.", degree, outfit, shoes);
}
} else if ("afternoon".equals(fit)) {
if (degree >= 10 && degree <= 18) {
outfit = "Shirt";
shoes = "Moccasins";
System.out.printf("It's %d degrees, get your %s and %s.", degree, outfit, shoes);
} else if (degree > 18 && degree <= 24) {
outfit = "T-Shirt";
shoes = "Sandals";
System.out.printf("It's %d degrees, get your %s and %s.", degree, outfit, shoes);
} else if (degree > 25) {
outfit = "Swim Suit";
shoes = "Barefoot";
System.out.printf("It's %d degrees, get your %s and %s.", degree, outfit, shoes);
}
} else {
outfit = "Shirt";
shoes = "Moccasins";
System.out.printf("It's %d degrees, get your %s and %s.", degree, outfit, shoes);
}
}
}
Благодаря ти колега, наистина това е проблема!