supertoniefy's blog

By supertoniefy, 15 years ago, In English

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
  • Vote: I like it
  • 0
  • Vote: I do not like it

| Write comment?
15 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it
Try to name your class with LATIN letters only
15 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it
i had same problem ,
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
  • 15 years ago, hide # ^ |
     
    Vote: I like it +3 Vote: I do not like it
    Yes, it is the same problem, and the answer is the same.

    Why could not you just open OSt's answer and just do what is told?
    • 15 years ago, hide # ^ |
       
      Vote: I like it 0 Vote: I do not like it
      i have changed publics become public , but it still same .
      • 15 years ago, hide # ^ |
         
        Vote: I like it 0 Vote: I do not like it
        Plz show your source code.
        • 15 years ago, hide # ^ |
           
          Vote: I like it 0 Vote: I do not like it
          No, do not ask him of this. We need no more spam. His "publics" is just secondary error, which is not related to this. He did not make his class public.
          • 15 years ago, hide # ^ |
            Rev. 3  
            Vote: I like it 0 Vote: I do not like it

            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

            • 15 years ago, hide # ^ |
              Rev. 2  
              Vote: I like it 0 Vote: I do not like it

              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?

              • 15 years ago, hide # ^ |
                Rev. 2  
                Vote: I like it 0 Vote: I do not like it

                ILUMT already changed publics, and asks to find another mistake from OSt, and OSt agreed to help.

                • 15 years ago, hide # ^ |
                   
                  Vote: I like it +8 Vote: I do not like it
                  I am sorry, but you is not attentive.

                  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.
  • 15 years ago, hide # ^ |
     
    Vote: I like it +15 Vote: I do not like it
    -class watermelon {
    +public class watermelon {
»
6 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

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();

}

}