結果
| 問題 |
No.525 二度寝の季節
|
| コンテスト | |
| ユーザー |
Anonymo94934790
|
| 提出日時 | 2017-08-05 21:57:26 |
| 言語 | C (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 282 bytes |
| コンパイル時間 | 185 ms |
| コンパイル使用メモリ | 28,160 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-10-11 20:42:56 |
| 合計ジャッジ時間 | 1,295 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 31 WA * 2 |
コンパイルメッセージ
main.c: In function 'main':
main.c:11:1: warning: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration]
11 | gets(s);
| ^~~~
| fgets
main.c:17:3: warning: implicit declaration of function 'atoi' [-Wimplicit-function-declaration]
17 | x=atoi(h);
| ^~~~
/usr/bin/ld: /tmp/ccKbVNcn.o: in function `main':
main.c:(.text.startup+0xd): 警告: the `gets' function is dangerous and should not be used.
ソースコード
#include <stdio.h>
#include<string.h>
int main(void)
{
char s[6];
int i;
int x;
int d;
char h[3],m[3];
gets(s);
h[0]=s[0];
h[1]=s[1];
m[0]=s[3];
m[1]=s[4];
x=atoi(h);
d=atoi(m);
d+=5;
if(d>60){
x++;
d=d-60;
}
if(x>23){
x=0;
}
printf("%02d:%02d\n",x,d);
return 0;
}
Anonymo94934790