Блог пользователя supertoniefy

Автор supertoniefy, 15 лет назад, По-английски

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
  • Проголосовать: нравится
  • 0
  • Проголосовать: не нравится

15 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится
Try to name your class with LATIN letters only
15 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится
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
»
6 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

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

}

}