Hey,m new to this site.I tried my first program Theatre Square in java .I ran it on my pc and it worked perfectly fine,but when i tried to submit here it gave a notification at the bottom saying
"Source should satisfy regex [^{}]*public\s+class\s+(\w+).*" and it wont submit.
Is there any specification on how to write the code? I even saw other solutions posted but still couldn't figure out what is wrong.
Help needed..
Thanks
Is there any specification on how to write the code? I even saw other solutions posted but still couldn't figure out what is wrong.
Help needed..
Thanks









there is any mistake with my code ,
this the code which i try to submit in watermelon problem.
import java.util.Scanner ;
class watermelon {
publics static void main (String[]args) {
Scanner gio = new Scanner (System.in);
int y = gio.nextInt ();
for (int w = y ; w >1 && w<100; ){
if (y%2==0){
System.out.println("YES");
System.exit(0);
}
else {
System.out.println("NO");
System.exit(0);
}
}
}
}
i really need your hand ,
thanks
Why could not you just open OSt's answer and just do what is told?
Why don't you want OSt to help??? And I think his question is not a spam...Don't look at this blog, if you don't want
Because OSt once wrote that main class should be public. Already.
Now the guy is presenting the program which has just the same error as in previous case (and more errors because of which it could never be compiled even locally) and asks "what is this?"
If the guy obviously do not want to waste his time for his sources - why others should?
ILUMT already changed publics, and asks to find another mistake from OSt, and OSt agreed to help.
OSt says to change class to public (it is not error, but it is required by CF to run tester).
ILUMT instead changed wrongly spelled modifier of method main (it is just error which shows that ILUMT even did not compile his solution). But this is not linked with this post at all.
+public class watermelon {
even iam new to this platform...and getting the same error..Source should satisfy regex [^{}]*public\s+(final)?\s*class\s+(\w+).*...kindly help
import java.util.*; import java.io.* ; import java.util.regex.*; import java.text.* ; import java.math.* ;
punlic class Solution {
public static void main(String[] args) { Scanner scan = new Scanner(System.in); int testCases = scan.nextInt(); for(int i=1;i<=testCases;i++) { int lengthArray = scan.nextInt(); int x = scan.nextInt(); int[] array = new int[lengthArray]; for(int j=0;j<lengthArray;j++) { array[i] = scan.nextInt(); } int result = 0; for(k=0;k<=x;k++) { result = result + array[x]; } if(result%2 != 0) { System.out.println("Yes"); } else { System.out.println("No"); } } scan.close(); }}