1 / 4
Apr 2019

I am trying to go for:


IDEONE is correct but always gives my NZEC error:

Here’s my tries without core code (i am using p array of results)
Here’s try like in sticked topic:
using System;class P{static void Main()
…int n;while((n=int.Parse(Console.ReadLine()))!=42)Console.WriteLine(p[n]);}}

Here’s my other try:
....string s;while((s=Console.ReadLine())!=null)Console.WriteLine(p[int.Parse(s)]);}}

And other one
...string s;while(!String.IsNullOrEmpty(s=Console.ReadLine()))Console.WriteLine(p[int.Parse(s)]);} }

  • created

    Apr '19
  • last reply

    May '19
  • 3

    replies

  • 770

    views

  • 2

    users

  • 1

    link

What’s the p array for, and where is it declared and populated?

I didn’t AC but I guess the input “index” is index out of bounds of array

I would expect so, but I can’t see a declaration