mirror of
https://github.com/theoludwig/programming-challenges.git
synced 2024-12-08 00:45:29 +01:00
feat(solutions): add acronyms/cs/function
This commit is contained in:
parent
d934d6e7c2
commit
552277f22d
@ -10,7 +10,7 @@ charset = utf-8
|
|||||||
trim_trailing_whitespace = true
|
trim_trailing_whitespace = true
|
||||||
insert_final_newline = true
|
insert_final_newline = true
|
||||||
|
|
||||||
[*.py]
|
[*.{py,cs}]
|
||||||
indent_size = 4
|
indent_size = 4
|
||||||
|
|
||||||
[*.txt]
|
[*.txt]
|
||||||
|
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,3 +1,5 @@
|
|||||||
|
using System;
|
||||||
|
|
||||||
namespace Solution
|
namespace Solution
|
||||||
{
|
{
|
||||||
class Program
|
class Program
|
||||||
@ -5,10 +7,10 @@ namespace Solution
|
|||||||
static void Main()
|
static void Main()
|
||||||
{
|
{
|
||||||
string line;
|
string line;
|
||||||
while ((line = System.Console.ReadLine()) != null)
|
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>
|
|
592
package-lock.json
generated
592
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -52,7 +52,7 @@
|
|||||||
"@types/date-and-time": "0.13.0",
|
"@types/date-and-time": "0.13.0",
|
||||||
"@types/jest": "27.0.1",
|
"@types/jest": "27.0.1",
|
||||||
"@types/mock-fs": "4.13.1",
|
"@types/mock-fs": "4.13.1",
|
||||||
"@types/node": "16.7.2",
|
"@types/node": "16.7.10",
|
||||||
"@types/validate-npm-package-name": "3.0.3",
|
"@types/validate-npm-package-name": "3.0.3",
|
||||||
"editorconfig-checker": "4.0.2",
|
"editorconfig-checker": "4.0.2",
|
||||||
"jest": "27.1.0",
|
"jest": "27.1.0",
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
FROM gcc:11.1.0
|
FROM gcc:11.2.0
|
||||||
COPY ./ ./
|
COPY ./ ./
|
||||||
RUN gcc solution.c --output=solution
|
RUN gcc solution.c --output=solution
|
||||||
CMD ["./solution"]
|
CMD ["./solution"]
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
FROM gcc:11.1.0
|
FROM gcc:11.2.0
|
||||||
COPY ./ ./
|
COPY ./ ./
|
||||||
RUN g++ solution.cpp --output=solution
|
RUN g++ solution.cpp --output=solution
|
||||||
CMD ["./solution"]
|
CMD ["./solution"]
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
FROM mcr.microsoft.com/dotnet/sdk:5.0
|
FROM mono:6.12
|
||||||
WORKDIR /usr/src/app
|
WORKDIR /usr/src/app
|
||||||
COPY ./ ./
|
COPY ./ ./
|
||||||
RUN dotnet restore
|
RUN mcs ./Solution.cs -out:Solution.exe
|
||||||
ENTRYPOINT ["dotnet", "run"]
|
ENTRYPOINT ["mono", "./Solution.exe"]
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
FROM dart:2.13.1
|
FROM dart:2.13.4
|
||||||
COPY ./ ./
|
COPY ./ ./
|
||||||
CMD ["dart", "run", "solution.dart"]
|
CMD ["dart", "run", "solution.dart"]
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
FROM node:16.3.0
|
FROM node:16.8.0
|
||||||
COPY ./ ./
|
COPY ./ ./
|
||||||
CMD ["node", "solution.js"]
|
CMD ["node", "solution.js"]
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
FROM python:3.9.5
|
FROM python:3.9.7
|
||||||
COPY ./ ./
|
COPY ./ ./
|
||||||
CMD ["python", "solution.py"]
|
CMD ["python", "solution.py"]
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
FROM rust:1.52.1
|
FROM rust:1.54.0
|
||||||
COPY ./ ./
|
COPY ./ ./
|
||||||
RUN rustc solution.rs
|
RUN rustc solution.rs
|
||||||
CMD ["./solution"]
|
CMD ["./solution"]
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
FROM node:16.3.0
|
FROM node:16.8.0
|
||||||
RUN npm install --global ts-node typescript @types/node
|
RUN npm install --global ts-node typescript @types/node
|
||||||
COPY ./ ./
|
COPY ./ ./
|
||||||
CMD ["ts-node", "solution.ts"]
|
CMD ["ts-node", "solution.ts"]
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
using System;
|
||||||
|
|
||||||
namespace Solution
|
namespace Solution
|
||||||
{
|
{
|
||||||
class Program
|
class Program
|
||||||
@ -5,10 +7,10 @@ namespace Solution
|
|||||||
static void Main()
|
static void Main()
|
||||||
{
|
{
|
||||||
string line;
|
string line;
|
||||||
while ((line = System.Console.ReadLine()) != null)
|
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>
|
|
Loading…
Reference in New Issue
Block a user