0
Can Someone help me ?
Cheers problem
9 Antworten
+ 3
Mihai Apostol [ ⚓ INACTIVE]
Interesting. It also works in java. But I guess it is a bug ;)
+ 2
Denise Roßberg Apparently it passes the test eventhough he prints in separate lines. I just checked 😱
+ 2
Daniele Cannella
Mihai Apostol [ ⚓ INACTIVE] already mentioned it. More than 10, but 10 not included.
elif f > 10:
+ 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!
+ 1
Daniele Cannella
More than 10 yards, ten not included.
By the way, interesting logic you have.
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
0
Pls Someone tell me how to fix this code, he give me 4 of 5 right answer.
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.
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));
}
}
}