1290:位数

xiaoxiao2021-02-28  127

1290:位数

Description

输入一个不超过10^9的正整数。

Output

输出它的位数。

sample input

12735

Smaple output

5

#include<iostream> using namespace std; int main() { int count=1; int n; cin>>n; int temp; while(temp!=0) { n=n/10; temp=n/10; count=count+1; } cout<<count; return 0; }

转载请注明原文地址: https://www.6miu.com/read-38237.html

最新回复(0)