C.Lynn's been speaking C# for 2 weeks. I'm listening to the company lecture. Instead of solving examples and giving assignments, I'm giving assignments and listening to explanations.
Even if I search the Internet, there are not many examples of c#, so I want to get help from masters.
c#
You have to do your homework on your own to make the class meaningful.
https://ko.wikibooks.org/wiki/%EB%B3%84_%EC%B0%8D%EA%B8%B0#C#
Please check this example.
linq to try it. Just the way.
void Main()
{
int n = 5;
var r = from i in Enumerable.Range(1, n)
select string.Concat(Enumerable.Repeat("*", i));
foreach (var line in r) Console.WriteLine(line);
Console.WriteLine();
var r2 = from i in Enumerable.Range(1, n).Reverse()
select string.Concat(Enumerable.Repeat("*", i));
foreach (var line in r2) Console.WriteLine(line);
Console.WriteLine();
var r3 = from i in Enumerable.Range(1, n).Concat(Enumerable.Range(1, n - 1).Reverse())
select string.Concat(Enumerable.Repeat("*", i));
foreach (var line in r3) Console.WriteLine(line);
Console.WriteLine();
var r4 = from i in Enumerable.Range(1, n)
select string.Concat(Enumerable.Range(1, i));
foreach (var line in r4) Console.WriteLine(line);
}
*
**
***
****
*****
*****
****
***
**
*
*
**
***
****
*****
****
***
**
*
1
12
123
1234
12345
© 2024 OneMinuteCode. All rights reserved.