Не мога да разбера къде ми е грешката в задача 8. Pet Shop.
Здравейте, пробвам се да реша задача 8, но когато поставя кода който съм написал ми излизат следните грешки:
Zero test #1 (Incorrect answer)
The zero tests are not included in the final result.
The process executing your submission for this test may not have received the output successfully. Please try to submit again the same solution. If the result does not change, then search the error in the submission itself.
The number of numbers in the user output is less than the expected output.
Expected output:
Your output:
1
28.5
1
Time used: 0.053 s
Memory used: 0.00 MB
Zero test #2 (Incorrect answer)
The zero tests are not included in the final result.
The process executing your submission for this test may not have received the output successfully. Please try to submit again the same solution. If the result does not change, then search the error in the submission itself.
The number of numbers in the user output is less than the expected output.
Expected output:
Your output:
1
68.5
1
Time used: 0.052 s
Memory used: 0.00 MB
Test #1 (Incorrect answer)
The process executing your submission for this test may not have received the output successfully. Please try to submit again the same solution. If the result does not change, then search the error in the submission itself.
Time used: 0.058 s
Memory used: 0.00 MB
Test #2 (Incorrect answer)
The process executing your submission for this test may not have received the output successfully. Please try to submit again the same solution. If the result does not change, then search the error in the submission itself.
Time used: 0.053 s
Memory used: 0.00 MB
Test #3 (Incorrect answer)
The process executing your submission for this test may not have received the output successfully. Please try to submit again the same solution. If the result does not change, then search the error in the submission itself.
Time used: 0.048 s
Memory used: 0.00 MB
Test #4 (Incorrect answer)
The process executing your submission for this test may not have received the output successfully. Please try to submit again the same solution. If the result does not change, then search the error in the submission itself.
Time used: 0.053 s
Memory used: 0.00 MB
Test #5 (Incorrect answer)
The process executing your submission for this test may not have received the output successfully. Please try to submit again the same solution. If the result does not change, then search the error in the submission itself.
Time used: 0.055 s
Memory used: 0.00 MB
Test #6 (Incorrect answer)
The process executing your submission for this test may not have received the output successfully. Please try to submit again the same solution. If the result does not change, then search the error in the submission itself.
Time used: 0.062 s
Memory used: 0.00 MB
Test #7 (Incorrect answer)
The process executing your submission for this test may not have received the output successfully. Please try to submit again the same solution. If the result does not change, then search the error in the submission itself.
Time used: 0.049 s
Memory used: 0.00 MB
Test #8 (Incorrect answer)
The process executing your submission for this test may not have received the output successfully. Please try to submit again the same solution. If the result does not change, then search the error in the submission itself.
Time used: 0.056 s
Memory used: 0.00 MB
Test #9 (Incorrect answer)
The process executing your submission for this test may not have received the output successfully. Please try to submit again the same solution. If the result does not change, then search the error in the submission itself.
Time used: 0.051 s
Memory used: 0.00 MB
Test #10 (Incorrect answer)
The process executing your submission for this test may not have received the output successfully. Please try to submit again the same solution. If the result does not change, then search the error in the submission itself.
Кода който съм написал е следния :
import java.util.Scanner;
public class Petshop {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int dog = Integer.parseInt(scan.nextLine());
int cat = Integer.parseInt(scan.nextLine());
double dogPrize = dog * 2.50;
int catPrize = cat * 4;
System.out.println( dogPrize + catPrize + "lv.");
}
}
Моля, за съдействие и обяснение къде и какво бъркам.
Благодаря ви предварително.
adding the space character before lv will only improve the readablity in the output. Addting it or not, doesn't affect the code.
The code looks fine to me.
Please ensure that you are providing valid input values, which are two Integers values.
It can also be a platform-specific issue and may not be related to the code. Try running this code on Java IDE or a text editor with Java support.