C#: class Program { static void Main(string[] args) { int a; a = Convert.ToInt32(Console.ReadLine()); if (a % 2 == 0) { a *= 2; } else { a *= 10; } Console.WriteLine(a);
Console.ReadLine(); } }
Pascal:
program n; var a: integer; begin readln(a); if a mod 2 = 0 then a *= 2 else a *= 10; writeln(a); end.
class Program
{
static void Main(string[] args)
{
int a;
a = Convert.ToInt32(Console.ReadLine());
if (a % 2 == 0)
{
a *= 2;
}
else
{
a *= 10;
}
Console.WriteLine(a);
Console.ReadLine();
}
}
Pascal:
program n;
var
a: integer;
begin
readln(a);
if a mod 2 = 0 then
a *= 2
else
a *= 10;
writeln(a);
end.