1
1
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:
Divlo 2021-09-05 10:54:20 +02:00
parent d934d6e7c2
commit 552277f22d
No known key found for this signature in database
GPG Key ID: 6F24DA54DA3967CF
17 changed files with 353 additions and 337 deletions

View File

@ -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]

View File

@ -0,0 +1,3 @@
# acronyms/cs/function
Created by [@Divlo](https://github.com/Divlo) on 5 September 2021.

View 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);
}
}
}

View File

@ -1,15 +1,17 @@
using System;
namespace Solution namespace Solution
{ {
class Program class Program
{
static void Main()
{ {
string line; static void Main()
while ((line = System.Console.ReadLine()) != null) {
{ string line;
while ((line = Console.ReadLine()) != null)
{
System.Console.WriteLine($"Hello, {line}!"); Console.WriteLine($"Hello, {line}!");
} }
}
} }
}
} }

View File

@ -1,6 +0,0 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net5.0</TargetFramework>
</PropertyGroup>
</Project>

592
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -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",

View File

@ -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"]

View File

@ -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"]

View File

@ -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"]

View File

@ -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"]

View File

@ -1,3 +1,3 @@
FROM node:16.3.0 FROM node:16.8.0
COPY ./ ./ COPY ./ ./
CMD ["node", "solution.js"] CMD ["node", "solution.js"]

View File

@ -1,3 +1,3 @@
FROM python:3.9.5 FROM python:3.9.7
COPY ./ ./ COPY ./ ./
CMD ["python", "solution.py"] CMD ["python", "solution.py"]

View File

@ -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"]

View File

@ -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"]

View File

@ -1,15 +1,17 @@
using System;
namespace Solution namespace Solution
{ {
class Program class Program
{
static void Main()
{ {
string line; static void Main()
while ((line = System.Console.ReadLine()) != null) {
{ string line;
while ((line = Console.ReadLine()) != null)
{
System.Console.WriteLine($"Hello, {line}!"); Console.WriteLine($"Hello, {line}!");
} }
}
} }
}
} }

View File

@ -1,6 +0,0 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net5.0</TargetFramework>
</PropertyGroup>
</Project>