結果
問題 | No.1415 100の倍数かつ正整数(1) |
ユーザー |
![]() |
提出日時 | 2021-03-24 23:48:31 |
言語 | C90 (gcc 12.3.0) |
結果 |
AC
|
実行時間 | 1 ms / 2,000 ms |
コード長 | 421 bytes |
コンパイル時間 | 120 ms |
コンパイル使用メモリ | 20,352 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-11-26 23:37:50 |
合計ジャッジ時間 | 864 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 24 |
コンパイルメッセージ
main.c: In function ‘main’: main.c:9:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 9 | scanf("%s", n); | ^~~~~~~~~~~~~~
ソースコード
#include <stdio.h> int main(void) { char n[102]; int i; int length = 0; scanf("%s", n); if(n[0] == '-'){ printf("0\n"); } else { for(i = 0;n[i] != 0;i++){ } length = i; if(length < 3){ printf("0\n"); } else{ for(i = 0;i < length - 2;i++){ printf("%c", n[i]); } printf("\n"); } } return 0; }