using
System;
using
System.Collections.Generic;
using
System.Linq;
using
System.Text;
using
System.Threading.Tasks;
namespace
_52pojie2
{
class
Program
{
static
void
Main(
string
[] args)
{
int
time, i, temp;
int
[] a =
new
int
[4];
a[2] = 0;
Console.WriteLine(
"Please input the time!"
);
time =
int
.Parse(Console.ReadLine());
temp = time;
if
(time < 0 || time > 2359)
{
Console.WriteLine(
"you have a wrong nuber!"
);
Console.Read();
}
else
{
for
(i = 0; i < 4; i++)
{
a[i] = time / (
int
)Math.Pow(10, 3 - i);
time -= a[i] * (
int
)Math.Pow(10, 3 - i);
}
time = a[0] * 10 + a[1];
temp = a[2] * 10 + a[3];
if
(time < 24 && temp < 60)
{
if
(a[0] == 0 && a[1] == 0)
{
Console.WriteLine(
"{0}{1}"
, a[2], a[3]);
Console.Read();
}
if
(time == 8)
{
Console.WriteLine(
"{0}"
, temp);
Console.Read();
}
if
(time > 8)
{
Console.WriteLine(
"{0}{1}"
, time - 8, temp);
Console.Read();
}
else
{
Console.WriteLine(
"{0}{1}"
, 16 + a[1], temp);
Console.Read();
}
}
else
{
Console.WriteLine(
"you have a wrong nuber"
);
Console.Read();
}
}
}
}
}