mirror of
https://github.com/theoludwig/programming-challenges.git
synced 2024-10-29 22:17:23 +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
|
||||
insert_final_newline = true
|
||||
|
||||
[*.py]
|
||||
[*.{py,cs}]
|
||||
indent_size = 4
|
||||
|
||||
[*.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,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>
|
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/jest": "27.0.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",
|
||||
"editorconfig-checker": "4.0.2",
|
||||
"jest": "27.1.0",
|
||||
|
@ -1,4 +1,4 @@
|
||||
FROM gcc:11.1.0
|
||||
FROM gcc:11.2.0
|
||||
COPY ./ ./
|
||||
RUN gcc solution.c --output=solution
|
||||
CMD ["./solution"]
|
||||
|
@ -1,4 +1,4 @@
|
||||
FROM gcc:11.1.0
|
||||
FROM gcc:11.2.0
|
||||
COPY ./ ./
|
||||
RUN g++ solution.cpp --output=solution
|
||||
CMD ["./solution"]
|
||||
|
@ -1,5 +1,5 @@
|
||||
FROM mcr.microsoft.com/dotnet/sdk:5.0
|
||||
FROM mono:6.12
|
||||
WORKDIR /usr/src/app
|
||||
COPY ./ ./
|
||||
RUN dotnet restore
|
||||
ENTRYPOINT ["dotnet", "run"]
|
||||
RUN mcs ./Solution.cs -out:Solution.exe
|
||||
ENTRYPOINT ["mono", "./Solution.exe"]
|
||||
|
@ -1,3 +1,3 @@
|
||||
FROM dart:2.13.1
|
||||
FROM dart:2.13.4
|
||||
COPY ./ ./
|
||||
CMD ["dart", "run", "solution.dart"]
|
||||
|
@ -1,3 +1,3 @@
|
||||
FROM node:16.3.0
|
||||
FROM node:16.8.0
|
||||
COPY ./ ./
|
||||
CMD ["node", "solution.js"]
|
||||
|
@ -1,3 +1,3 @@
|
||||
FROM python:3.9.5
|
||||
FROM python:3.9.7
|
||||
COPY ./ ./
|
||||
CMD ["python", "solution.py"]
|
||||
|
@ -1,4 +1,4 @@
|
||||
FROM rust:1.52.1
|
||||
FROM rust:1.54.0
|
||||
COPY ./ ./
|
||||
RUN rustc solution.rs
|
||||
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
|
||||
COPY ./ ./
|
||||
CMD ["ts-node", "solution.ts"]
|
||||
|
@ -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>
|
Loading…
Reference in New Issue
Block a user