CS
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
using System;
using static System.Console;
// Por Marfik Em
// 10/12/2017 (DD/MM/AAAA)
namespace Challenge
{
class Program
{
static void Main(string[] args)
{
try {
int n = Int32.Parse(ReadLine());
n = n >= 0 ? n : -n;
int squareN = 0;
for (int i = 0; i < n; i++)
squareN += n;
WriteLine("Square of '{0}' is '{1}'.", n, squareN);
}
catch {
WriteLine("Write only whole numbers.");
}
}
}
}
Enter to Rename, Shift+Enter to Preview
OUTPUT
Run