結果

問題 No.652 E869120 and TimeZone
ユーザー kotatsugame
提出日時 2018-06-14 23:54:17
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 1,000 ms
コード長 320 bytes
コンパイル時間 413 ms
コンパイル使用メモリ 62,592 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-06-11 12:25:08
合計ジャッジ時間 1,269 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 5
other AC * 30
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp:7:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    7 | main()
      | ^~~~

ソースコード

diff #

#include<iostream>
#include<cstdio>
using namespace std;
int a,b,c,d;
float x;
char p;
main()
{
	scanf("%d %d UTC%c%d.%d",&a,&b,&p,&c,&d);
	if(p=='+')
	{
		b=b+d*6;
		if(b>=60)b-=60,a++;
		a=(a-9+c+24)%24;
	}
	else
	{
		if(d!=0)b=b+(10-d)*6,c++;
		if(b>=60)b-=60,a++;
		a=(a-9-c+24)%24;
	}
	printf("%02d:%02d\n",a,b);
}
0