結果
| 問題 | No.525 二度寝の季節 |
| コンテスト | |
| ユーザー |
Anonymo94934790
|
| 提出日時 | 2017-08-05 21:58:12 |
| 言語 | C90 (gcc 15.2.0) |
| 結果 |
WA
(最新)
AC
(最初)
|
| 実行時間 | - |
| コード長 | 283 bytes |
| 記録 | |
| コンパイル時間 | 51 ms |
| コンパイル使用メモリ | 34,816 KB |
| 実行使用メモリ | 5,888 KB |
| 最終ジャッジ日時 | 2026-07-25 01:10:01 |
| 合計ジャッジ時間 | 1,826 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 31 WA * 2 |
コンパイルメッセージ
main.c: In function 'main':
main.c:11:1: warning: 'gets' is deprecated [-Wdeprecated-declarations]
11 | gets(s);
| ^~~~
In file included from main.c:1:
/usr/include/stdio.h:667:14: note: declared here
667 | extern char *gets (char *__s) __wur __attribute_deprecated__;
| ^~~~
/usr/bin/ld: /tmp/ccEcP8zq.o: in function `main':
main.c:(.text.startup+0xb): 警告: 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