1113 -- 位数
位数
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);}}}
本文来自互联网用户投稿,文章观点仅代表作者本人,不代表本站立场,不承担相关法律责任。如若转载,请注明出处。 如若内容造成侵权/违法违规/事实不符,请点击【内容举报】进行投诉反馈!
