+ 1
My code is always printing Lion
import java.util.Scanner; public class Program { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String input = sc.nextLine(); String [] x = input.split(" "); for (int i=0;i<x.length;++i){ System.out.print(x[i]); if (x[i]=="Rawr"){ System.out.print("Tiger "); } else if(x[i]=="Chirp"){ System.out.print("Bird "); } else if(x[i]=="Ssss"){ System.out.print("Snake "); } else{ System.out.print("Lion "); } } } }
2 Réponses
+ 3
https://www.sololearn.com/Discuss/2371797/?ref=app
same problem as yours, ypu should check it out
+ 1
Tysm