結果
問題 | No.652 E869120 and TimeZone |
ユーザー |
![]() |
提出日時 | 2021-05-17 02:39:40 |
言語 | C (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 609 bytes |
コンパイル時間 | 106 ms |
コンパイル使用メモリ | 29,696 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2024-10-05 16:09:18 |
合計ジャッジ時間 | 937 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | WA * 5 |
other | WA * 30 |
ソースコード
#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;minute += 60;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;}