2884번 - 알람 시계
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApp3
{
internal class Program
static void Main(string[] args)
string s = Console.ReadLine();
string[] ss = s.Split();
int h = int.Parse(ss[0]);
int m = int.Parse(ss[1]);
if (m < 45)
m += 60;
m -= 45;
if (h == 0)
h += 24;
}
h -= 1;
Console.WriteLine("{0} {1}", h, m);
반례)
1 45
답 :
1 0
댓글을 작성하려면 로그인해야 합니다.
bluestar412 1년 전
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApp3
{
internal class Program
{
static void Main(string[] args)
{
{
string s = Console.ReadLine();
string[] ss = s.Split();
int h = int.Parse(ss[0]);
int m = int.Parse(ss[1]);
if (m < 45)
{
m += 60;
m -= 45;
if (h == 0)
{
h += 24;
}
h -= 1;
Console.WriteLine("{0} {1}", h, m);
}
}
}
}
}