5
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

はじめに

F#8でプログラミング課題に挑戦しました

問題

文字列を1行ずつ2つ、標準入力で入力し、2つの文字列の長さが同じなら「Yes」、違う場合は「No」を標準出力に出力してください。

実装したコード

今回は即興でコーディングしたので、命名規則はぐちゃぐちゃです。

let str1 = System.Console.ReadLine()
let str2 = System.Console.ReadLine()
let num1 = str1.Length
let num2 = str2.Length
if num1 = num2 then
  System.Console.WriteLine("Yes")
else
  System.Console.WriteLine("No")

最後に

実務でF#を使うことはないのですが、Microsoftが開発した言語ということで挑戦しました。

5
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?