0

Can Someone help me ?

Cheers problem

13th Mar 2020, 9:23 PM
Daniele Cannella
9 Antworten
+ 3
Mihai Apostol [ ⚓ INACTIVE] Interesting. It also works in java. But I guess it is a bug ;)
13th Mar 2020, 9:47 PM
Denise Roßberg
Denise Roßberg - avatar
+ 2
Denise Roßberg Apparently it passes the test eventhough he prints in separate lines. I just checked 😱
13th Mar 2020, 9:44 PM
Mihai Apostol
Mihai Apostol - avatar
+ 2
Daniele Cannella Mihai Apostol [ ⚓ INACTIVE] already mentioned it. More than 10, but 10 not included. elif f > 10:
14th Mar 2020, 9:32 PM
Denise Roßberg
Denise Roßberg - avatar
+ 1
The problem is that you print every Ra! in a new line. For example: Input: 3 Output: Ra! Ra! Ra! Expected: Ra!Ra!Ra!
13th Mar 2020, 9:38 PM
Denise Roßberg
Denise Roßberg - avatar
+ 1
Daniele Cannella More than 10 yards, ten not included. By the way, interesting logic you have.
13th Mar 2020, 9:40 PM
Mihai Apostol
Mihai Apostol - avatar
0
f=int(input()) a=1*f if f<1: print('shh') elif f>=10: print("High Five") else: while 1==1: f+=1 print('Ra!') if f==(a*2): break
13th Mar 2020, 9:24 PM
Daniele Cannella
0
Pls Someone tell me how to fix this code, he give me 4 of 5 right answer.
13th Mar 2020, 9:25 PM
Daniele Cannella
0
Thx to all, so what i can do to my code to make It work ? The problem Isn't the output in saparate Lines because the First 3 problem and the last are correct but the 4th Isn't right.
14th Mar 2020, 9:11 PM
Daniele Cannella
0
import java.util.*; public class Program { public static void main(String[] args) { int input; String str="Ra!"; Scanner sc=new Scanner(System.in); input=sc.nextInt(); if(input>10) { System.out.println("High Five"); } else if(input<=0) { System.out.println("shh"); } else { System.out.println(str.repeat(input)); } } }
13th Apr 2020, 4:40 AM
kartik narang
kartik narang - avatar