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
clientdata.cs
cs002
Generic Reference constraint
Selection Sort
4 squares theorem
Add char to non-numerical words only
Importent Gen_Coverent Example-1
ARM
TestApp
comparer implementation