-
Notifications
You must be signed in to change notification settings - Fork 0
/
mult.cs
45 lines (43 loc) · 1.04 KB
/
mult.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;
using System.Threading;
using System.Reflection;
namespace tetris
{
public class Program
{
public static int Main(string[] args)
{
int a = 0;
int b = 0;
int c = 0;
string inA = Console.ReadLine();
string inB = Console.ReadLine();
bool result1 = int.TryParse(inA, out a);
bool result2 = int.TryParse(inB, out b);
if (!result1 || !result2)
{
Console.WriteLine("invalid entry");
return 0;
}
else if (result1 && result2)
{
while (b != 0)
{
c = c + a;
b = b - 1;
}
Console.WriteLine(c);
return 1;
}
else
{
return 0;
}
}
}
}