mirror of
https://github.com/theoludwig/programming-challenges.git
synced 2025-05-18 12:02:53 +02:00
feat(solutions): add acronyms/cs/function
This commit is contained in:
3
challenges/acronyms/solutions/cs/function/README.md
Normal file
3
challenges/acronyms/solutions/cs/function/README.md
Normal file
@ -0,0 +1,3 @@
|
||||
# acronyms/cs/function
|
||||
|
||||
Created by [@Divlo](https://github.com/Divlo) on 5 September 2021.
|
19
challenges/acronyms/solutions/cs/function/Solution.cs
Normal file
19
challenges/acronyms/solutions/cs/function/Solution.cs
Normal file
@ -0,0 +1,19 @@
|
||||
using System;
|
||||
|
||||
namespace Solution
|
||||
{
|
||||
class Program
|
||||
{
|
||||
static void Main()
|
||||
{
|
||||
string line = Console.ReadLine();
|
||||
string[] words = line.Replace("\"", "").Split(' ');
|
||||
string result = "";
|
||||
foreach (string word in words)
|
||||
{
|
||||
result += word[0].ToString().ToUpper();
|
||||
}
|
||||
Console.WriteLine(result);
|
||||
}
|
||||
}
|
||||
}
|
@ -1,15 +1,17 @@
|
||||
using System;
|
||||
|
||||
namespace Solution
|
||||
{
|
||||
class Program
|
||||
{
|
||||
static void Main()
|
||||
class Program
|
||||
{
|
||||
string line;
|
||||
while ((line = System.Console.ReadLine()) != null)
|
||||
{
|
||||
static void Main()
|
||||
{
|
||||
string line;
|
||||
while ((line = Console.ReadLine()) != null)
|
||||
{
|
||||
|
||||
System.Console.WriteLine($"Hello, {line}!");
|
||||
}
|
||||
Console.WriteLine($"Hello, {line}!");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +0,0 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net5.0</TargetFramework>
|
||||
</PropertyGroup>
|
||||
</Project>
|
Reference in New Issue
Block a user