Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Problem Name: single_digit
//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) { Console.WriteLine("Enter and Integer !"); int x = 0; x = Convert.ToInt32(Console.ReadLine()); //Recussive Code Until Get the desired results while (Convert.ToString(x).Length > 1) { var digits = x.ToString().Select(t => int.Parse(t.ToString())).ToArray(); x = 0; for (int i = 0; i < digits.Length; i++) { x += digits[i]; } } Console.WriteLine("Printing Answer"); Console.WriteLine(x); Console.ReadKey(); } } }
run
|
edit
|
history
|
help
0
TCP
Problem: fb_series
Date Comparison
Html clean - remove image style
text
1
іфи
opQ 3
Create Sealed Class Object & call sealed method with non sealed class
Programmer DNA