Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Number of Digits in a Number
//Rextester.Program.Main is the entry point for your code. Don't change it. //Compiler version 4.0.30319.17929 for Microsoft (R) .NET Framework 4.5 using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; namespace Rextester { public class Program { public static void Main(string[] args) { int a = Convert.ToInt32(Console.ReadLine()); int OriginalValue = a; int count=0; while(a>0) { if(a<=9) { count = count + 1; } else if(a>9) { count = count + 2; } else if(a>99) { count = count + 3; } a--; } Console.WriteLine("Number is: " + OriginalValue + " \nDigits Count is: " + count); } } }
run
|
edit
|
history
|
help
0
sdfghyjujyhtgrfedcf
First code
Custom long date
Digging Deeper
Unsorted array with most occurence
expresiones switch
Inheritance Ctor
Class
фабрика статик
Greatest Common Divisor of 2 or more numbers.