位数
Time Limit:1000MS Memory Limit:65536K
Total Submit:234 Accepted:204
Description
输入一个不超过10^9的正整数,输出它的位数,例如12735的位数是5,
Input
输入一个不超过10^9的正整数
Output
,输出它的位数
Sample Input
12735
Sample Output
5
Source
刘汝佳程序入门
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace AK1113 {
class Program {
static void Main(string[] args) {
long n = long.Parse(Console.ReadLine()), i = 0;
while (n > 0) {
i++;
n /= 10;
}
Console.WriteLine(i);
}
}
}