結果
問題 |
No.652 E869120 and TimeZone
|
ユーザー |
![]() |
提出日時 | 2021-05-17 02:33:54 |
言語 | C (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 562 bytes |
コンパイル時間 | 407 ms |
コンパイル使用メモリ | 28,672 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2024-10-05 15:59:10 |
合計ジャッジ時間 | 1,428 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 WA * 1 |
other | AC * 16 WA * 14 |
ソースコード
#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; if (minute >= 60) { hour++; } if (hour >= 24) { hour-=24; } printf("%02d:%02d\n",hour,minute); return 0; }