結果
| 問題 |
No.671 1000000007
|
| コンテスト | |
| ユーザー |
sasa
|
| 提出日時 | 2025-03-17 14:22:57 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 375 bytes |
| コンパイル時間 | 266 ms |
| コンパイル使用メモリ | 28,544 KB |
| 実行使用メモリ | 7,324 KB |
| 最終ジャッジ日時 | 2025-03-17 14:22:58 |
| 合計ジャッジ時間 | 903 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 3 |
| other | AC * 1 WA * 8 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:18:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
18 | scanf("%lld",&val);
| ~~~~~^~~~~~~~~~~~~
ソースコード
#include <stdio.h>
#include <stdlib.h>
unsigned int get_num_digit(int x) {
unsigned int abs_x = abs(x);
unsigned int num_digit = 0;
do {
abs_x = abs_x / 10;
num_digit++;
} while (abs_x > 0);
return num_digit;
}
int main(void){
long long val = 0;
scanf("%lld",&val);
int digit = get_num_digit(val);
printf("%d\n",digit);
}
sasa