結果
| 問題 | No.652 E869120 and TimeZone |
| コンテスト | |
| ユーザー |
Shirapon_pon
|
| 提出日時 | 2021-05-17 02:36:48 |
| 言語 | C (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 591 bytes |
| 記録 | |
| コンパイル時間 | 288 ms |
| コンパイル使用メモリ | 29,440 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-10-05 16:03:41 |
| 合計ジャッジ時間 | 1,115 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 5 |
| other | AC * 22 WA * 8 |
ソースコード
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
int main(int argc, char *argv[]){
int hour,minute;
char timezone[10];
char tmp[10]={0};
int h_timezone,m_timezone = 0;
scanf("%d%d%s",&hour,&minute,timezone);
hour += 15;
strncpy(tmp,timezone+3,5);
h_timezone = atof(tmp);
m_timezone = atof(tmp)*60-h_timezone*60;
hour +=h_timezone;
minute += m_timezone;
while (minute >= 60)
{
minute -= 60;
hour++;
}
while (hour >= 24)
{
hour -=24;
}
printf("%02d:%02d\n",hour,minute);
return 0;
}
Shirapon_pon