Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
18
Task/Repeat/C-sharp/repeat.cs
Normal file
18
Task/Repeat/C-sharp/repeat.cs
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
using System;
|
||||
|
||||
namespace Repeat {
|
||||
class Program {
|
||||
static void Repeat(int count, Action<int> fn) {
|
||||
if (null == fn) {
|
||||
throw new ArgumentNullException("fn");
|
||||
}
|
||||
for (int i = 0; i < count; i++) {
|
||||
fn.Invoke(i + 1);
|
||||
}
|
||||
}
|
||||
|
||||
static void Main(string[] args) {
|
||||
Repeat(3, x => Console.WriteLine("Example {0}", x));
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue