Created
July 22, 2018 06:09
-
-
Save kureikei/f1e56fa703958592554628049f5bf508 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
var r = new Random(); | |
for (int i = 0; i < 10; i++) | |
{ | |
var a = r.Next(1, 10); | |
var b = r.Next(1, 10); | |
Console.Write($"{a} + {b} = "); | |
Console.WriteLine(int.TryParse(Console.ReadLine(), out var input) && input == a + b ? | |
"正解!" : | |
$"不正解!答え: {a + b}"); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment