Quantcast
Channel: CodeChef Discuss - latest questions
Viewing all articles
Browse latest Browse all 40121

runtime error

$
0
0
import java.io.*;
class q
{

    public static void main()throws IOException
    {
        InputStreamReader isr=new InputStreamReader(System.in);
        BufferedReader br=new BufferedReader(isr);
        int arr[]=new int[5];
        for(int i=0;i<=5;i++)
        {
            do
            {
                arr[i]=Integer.parseInt(br.readLine());
            }
            while(arr[i]!=42);

        }
        for(int j=0;j<=5;j++)
        {
            while(arr[j]!=42)
            {
                System.out.println(arr[j]);
            }
        }
    }
}

Viewing all articles
Browse latest Browse all 40121

Trending Articles