+ 2
C# solution search
Can’t understand why it want { in 12 line https://code.sololearn.com/czqDPmQUaX7o/?ref=app
4 Respostas
+ 2
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SoloLearn
{
class Program
{
static void Main(string[] args)
{ public int gain = Console.ReadLine();
string[] games = { "Alien Shooter", "Tic Tac Toe", "Snake", "Puzzle", "Football", "Invalid number" };
arrayX p = new arrayX();
p.ArrayX = gain;
arrayX(games[p.ArrayX]);
}
}
class arrayX
{
public int pepperX;
public arrayX()
{
Console.WriteLine();
}
public class ArrayX
{
get
{ return pepperX }
set {
if ( value == 0; )
{ pepperX = value;}
else if ( value == 1; )
{ pepperX = value;}
else if ( value == 2; )
{ pepperX = value;}
else if ( value == 3; )
{ pepperX = value;}
else if ( value == 4; )
{ pepperX = value;}
else { value = 5; }
}
}
}
}
+ 2
help please
+ 1
like this
0
My code:
...
static void Main(string[] args)
{
public int gain = Console.ReadLine();
string[] games = { "Alien Shooter", "Tic Tac Toe", "Snake", "Puzzle", "Football", "Invalid number" };
arrayX p = new arrayX();
p.ArrayX = gain;
arrayX(games[p.ArrayX]);
}
...
Your code:
...
static void Main(string[] args)
{ public int gain = Console.ReadLine();
string[] games = { "Alien Shooter", "Tic Tac Toe", "Snake", "Puzzle", "Football", "Invalid number" };
arrayX p = new arrayX();
p.ArrayX = gain;
arrayX(games[p.ArrayX]);
}
...