結果
| 問題 | No.525 二度寝の季節 |
| コンテスト | |
| ユーザー |
Anonymo94934790
|
| 提出日時 | 2017-08-05 21:58:12 |
| 言語 | C90(gcc15) (gcc 15.2.0) |
| 結果 |
WA
(最新)
AC
(最初)
|
| 実行時間 | - |
| コード長 | 283 bytes |
| 記録 | |
| コンパイル時間 | 190 ms |
| コンパイル使用メモリ | 36,608 KB |
| 最終ジャッジ日時 | 2026-02-24 00:50:29 |
|
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 29 WA * 4 |
コンパイルメッセージ
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/ccDFLVXJ.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