u19
This commit is contained in:
parent
bb40f5bd19
commit
52677dbb23
2 changed files with 23 additions and 0 deletions
22
ulohyfs/src/u19.fs
Normal file
22
ulohyfs/src/u19.fs
Normal file
|
@ -0,0 +1,22 @@
|
|||
module UlohyFs.u19
|
||||
|
||||
open System.IO
|
||||
open UlohyFs.Attributes
|
||||
open System
|
||||
|
||||
let startsWithConsonant (s: string) =
|
||||
let consonants = "bcdfghjklmnpqrstvwxz"
|
||||
s.ToLower().[0] |> consonants.Contains
|
||||
|
||||
let startsWithVowel (s: string) =
|
||||
let vowels = "aeiouy"
|
||||
s.ToLower().[0] |> vowels.Contains
|
||||
|
||||
[<Uloha(19)>]
|
||||
let uloha15() =
|
||||
printfn "zadaj slovo"
|
||||
let input = Console.ReadLine()
|
||||
if startsWithConsonant input then
|
||||
printfn "%s%cay" (input.Substring(1)) input.[0]
|
||||
elif startsWithVowel input then
|
||||
printfn "%sway" input
|
|
@ -12,6 +12,7 @@
|
|||
<Compile Include="src\u15.fs" />
|
||||
<Compile Include="src\u17.fs" />
|
||||
<Compile Include="src\u18.fs" />
|
||||
<Compile Include="src\u19.fs" />
|
||||
<Compile Include="src\Program.fs" />
|
||||
</ItemGroup>
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue