Skip to main content
Commonmark migration
Source Link

#C#, 156+31=187 bytes

C#, 156+31=187 bytes

The code requires the following usings:

using System;using System.Linq; 

Here the code:

class P{static void Main(string[]a){var b=ulong.Parse(Console.ReadLine());var d=1U;for(;(b*d).ToString().Any(x=>x!='0'&&x!='1');d++);Console.WriteLine(d);}} 

Ungolfed:

using System; using System.Linq; class P { static void Main(string[] a) { var b = ulong.Parse(Console.ReadLine()); var d = 1U; for (; (b*d).ToString().Any(x => x != '0' && x != '1'); d++); Console.WriteLine(d); } } 

#C#, 156+31=187 bytes

The code requires the following usings:

using System;using System.Linq; 

Here the code:

class P{static void Main(string[]a){var b=ulong.Parse(Console.ReadLine());var d=1U;for(;(b*d).ToString().Any(x=>x!='0'&&x!='1');d++);Console.WriteLine(d);}} 

Ungolfed:

using System; using System.Linq; class P { static void Main(string[] a) { var b = ulong.Parse(Console.ReadLine()); var d = 1U; for (; (b*d).ToString().Any(x => x != '0' && x != '1'); d++); Console.WriteLine(d); } } 

C#, 156+31=187 bytes

The code requires the following usings:

using System;using System.Linq; 

Here the code:

class P{static void Main(string[]a){var b=ulong.Parse(Console.ReadLine());var d=1U;for(;(b*d).ToString().Any(x=>x!='0'&&x!='1');d++);Console.WriteLine(d);}} 

Ungolfed:

using System; using System.Linq; class P { static void Main(string[] a) { var b = ulong.Parse(Console.ReadLine()); var d = 1U; for (; (b*d).ToString().Any(x => x != '0' && x != '1'); d++); Console.WriteLine(d); } } 
Edit: Improved code to save 9 bytes
Source Link
raznagul
  • 482
  • 3
  • 8

#C#, 165+31=210156+31=187 bytes

The code requires the following usings:

using System;using System.Linq; 

Here the code:

class P{static void Main(string[]a){var b=ulong.Parse(Console.ReadLine());var c=b;int d=1;ford=1U;for(;c;(b*d).ToString().Any(x=>x!='0'&&x!='1');d++){c+=b;}Console;Console.WriteLine(d);}} 

Ungolfed:

using System; using System.Linq; class P { static void Main(string[] a) { var b = ulong.Parse(Console.ReadLine()); var c = b; int d = 1;1U; for (; c(b*d).ToString().Any(x => x != '0' && x != '1'); d++) { c += b; }; Console.WriteLine(d); } } 

#C#, 165+31=210 bytes

The code requires the following usings:

using System;using System.Linq; 

Here the code:

class P{static void Main(string[]a){var b=ulong.Parse(Console.ReadLine());var c=b;int d=1;for(;c.ToString().Any(x=>x!='0'&&x!='1');d++){c+=b;}Console.WriteLine(d);}} 

Ungolfed:

using System; using System.Linq; class P { static void Main(string[] a) { var b = ulong.Parse(Console.ReadLine()); var c = b; int d = 1; for (; c.ToString().Any(x => x != '0' && x != '1'); d++) { c += b; } Console.WriteLine(d); } } 

#C#, 156+31=187 bytes

The code requires the following usings:

using System;using System.Linq; 

Here the code:

class P{static void Main(string[]a){var b=ulong.Parse(Console.ReadLine());var d=1U;for(;(b*d).ToString().Any(x=>x!='0'&&x!='1');d++);Console.WriteLine(d);}} 

Ungolfed:

using System; using System.Linq; class P { static void Main(string[] a) { var b = ulong.Parse(Console.ReadLine()); var d = 1U; for (; (b*d).ToString().Any(x => x != '0' && x != '1'); d++); Console.WriteLine(d); } } 
Source Link
raznagul
  • 482
  • 3
  • 8

#C#, 165+31=210 bytes

The code requires the following usings:

using System;using System.Linq; 

Here the code:

class P{static void Main(string[]a){var b=ulong.Parse(Console.ReadLine());var c=b;int d=1;for(;c.ToString().Any(x=>x!='0'&&x!='1');d++){c+=b;}Console.WriteLine(d);}} 

Ungolfed:

using System; using System.Linq; class P { static void Main(string[] a) { var b = ulong.Parse(Console.ReadLine()); var c = b; int d = 1; for (; c.ToString().Any(x => x != '0' && x != '1'); d++) { c += b; } Console.WriteLine(d); } }