0
Level points C#
Please tell where i am wrong
3 Respostas
+ 10
static void Main(string[] args)
{
int levels = Convert.ToInt32(Console.ReadLine());
Console.WriteLine(Points(levels));
}
static int Points(int levels)
{
//your code goes here
int total = (levels + 1) * levels / 2;
return total;
+ 3
Read Question properly for this problem u need one loop upto base case suppose if u have 5 level then loop should start form 0 to 4 he u have to add points sum=sum+i;
Or u can do this with recursive type function suppose n is a number
return n+(n-1)