You are not logged in. Please login at www.codechef.com to post your questions!

×

Code not compiling for CHN15A, what is wrong with my solution working finein my IDE

Compilation Error:

Main.java:6: error: class MutatedMinions is public, should be declared in a file named MutatedMinions.java public class MutatedMinions { ^ 1 error


My Solution is pasted bellow

import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.Scanner;

public class MutatedMinions {

public static void main(String[] args) throws NumberFormatException, IOException {
    // TODO Auto-generated method stub
    BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
    for(int i=0; i < Integer.parseInt(input.readLine());i++) {
        String inputArr[] = input.readLine().split(" ");
        String inputArr2[] = input.readLine().split(" ");
        int mutant = Integer.parseInt(inputArr[1]);
        int count = 0;
        for(int j = 0;j < Integer.parseInt(inputArr[0]); j++) {
            if((Integer.parseInt(inputArr2[j])*mutant)%7 == 0) {
                count++;
            }

        }
        System.out.println(count);
    }

}

}

asked 16 Dec '18, 13:47

prakash4453's gravatar image

0★prakash4453
1
accept rate: 0%


link

answered 23 Dec '18, 19:29

prakash4453's gravatar image

0★prakash4453
1
accept rate: 0%

toggle preview
Preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported
  • mathemetical formulas in Latex between $ symbol

Question tags:

×87
×1

question asked: 16 Dec '18, 13:47

question was seen: 55 times

last updated: 23 Dec '18, 19:29