Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Decimal test
//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) { //Your code goes here Console.WriteLine("Hello, world!"); double a = 50.4; double b = 49; string a_str = a.ToString(); string b_str = b.ToString(); int a_zeroes; if (Math.Floor(a)==0){ a_zeroes = a_str.Substring(a_str.IndexOf(",")+1).Length; } else a_zeroes=0; int b_zeroes; if (Math.Floor(b)==0) { b_zeroes = b_str.Substring(b_str.IndexOf(",")+1).Length; } else b_zeroes=0; int zeroes = Math.Max(a_zeroes,b_zeroes); int a_int = Convert.ToInt32(a*Tens(zeroes)); int b_int = Convert.ToInt32(b*Tens(zeroes)); Console.WriteLine(a_int + " " + b_int); } public static int Tens(int num) { if (num==1){ return 10; } else return Tens(num-1)*10; } } }
run
|
edit
|
history
|
help
0
Find median in a stream
.,.
Fibonacci Series
MyGenerics
UTC to Ireland time convertion v1.1
Group by Example
Selection sort
Coding
EDFCSCSA V
Testing 004