結果
| 問題 | No.671 1000000007 | 
| コンテスト | |
| ユーザー |  sasa | 
| 提出日時 | 2025-03-17 14:21:15 | 
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) | 
| 結果 | 
                                WA
                                 
                             | 
| 実行時間 | - | 
| コード長 | 454 bytes | 
| コンパイル時間 | 350 ms | 
| コンパイル使用メモリ | 28,544 KB | 
| 実行使用メモリ | 7,324 KB | 
| 最終ジャッジ日時 | 2025-03-17 14:21:16 | 
| 合計ジャッジ時間 | 1,270 ms | 
| ジャッジサーバーID (参考情報) | judge1 / judge4 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | WA * 3 | 
| other | WA * 9 | 
コンパイルメッセージ
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",digit);
	
	if(digit > 10){
		printf("%d",digit - 10);	
	}else{
		printf("%d",10 - digit);
	}
	
	
}
            
            
            
        