-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathA. Helpful Maths.cs
49 lines (41 loc) · 1.05 KB
/
A. Helpful Maths.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication14
{
class Program
{
static void Main(string[] args)
{
int numb = int.Parse(Console.ReadLine());
List<string> cola = new List<string>();
cola.Add("Sheldon");
cola.Add("Leonard");
cola.Add("Penny");
cola.Add("Rajesh");
cola.Add("Howard");
int i = 0;
int count = 0;
while (count < numb)
{
if (i < 5)
{
cola.Add(cola[i]);
cola.Add(cola[i]);
cola.RemoveAt(0);
i++;
}
else
{
i = 0;
}
count++;
}
Console.WriteLine(cola[0]);
Console.ReadLine();
//Console.WriteLine(cola[numb - 1]);
}
}
}