結果

問題 No.1070 Missing a space
ユーザー れあ
提出日時 2025-01-12 22:45:06
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 287 bytes
コンパイル時間 1,190 ms
コンパイル使用メモリ 77,548 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2025-01-12 22:45:09
合計ジャッジ時間 1,705 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample WA * 3
other WA * 7
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:7:22: warning: ‘len’ may be used uninitialized [-Wmaybe-uninitialized]
    7 |         unsigned int len;
      |                      ^~~
main.cpp:19:29: warning: ‘zero’ may be used uninitialized [-Wmaybe-uninitialized]
   19 |                         zero++;
      |                         ~~~~^~
main.cpp:8:22: note: ‘zero’ was declared here
    8 |         unsigned int zero;
      |                      ^~~~

ソースコード

diff #

#include <iostream>
using namespace std;

int main(){
	
	unsigned int input;
	unsigned int len;
	unsigned int zero;
	
	cin >> input;
	
	while (input!=0){
		
		input /= 10;
		len++;
		
		if(input % 10 == 0){
			
			zero++;
			
		}
		
	}
	
	cout << len - zero - 1 << endl;
	
	
	return 0;
}
0