+ 2
why my code showing error in sololearn but its working in Intellij idea correctly
import java.util.Scanner public class Program { public static void main(String[] args) { Scanner input = new Scanner(System.in); String all = "0abcdefghijklmnopqrstuvwxyz"; String name; System.out.println("Enter your name without Space :-"); name = input.next(); name = name.toLowerCase(); System.out.println(name); char [] ch = name.toCharArray(); int sum=0; for(char x: ch) sum = sum + all.indexOf(x); System.out.println("Your Lucky Number Is : "+sum); } }
2 Respostas
+ 8
Missing semicolon on the very first line of your code where you are importing.
+ 1
Hmm, if you paste this into a Java code, it tells you exactly what it's expecting.