using System;
class HelloWorld {
public static int ikki(int n){
if (n > 1)
{
string r="";
int re = n % 2;
r = Convert.ToString(re) + r;
r = Convert.ToString(n) + r;
Console.WriteLine(r);
return ikki(n/2);
}
else return 0;
}
static void Main() {
int a=Convert.ToInt32(Console.ReadLine());
a=ikki(a);
}
}
using System;
public class Exercise11
{
public static void Main()
{
string r;
int n = Convert.ToInt32(Console.ReadLine());
r= "";
while (n > 1)
{
int re = n % 2;
r = Convert.ToString(re) + r;
n /= 2;
}
r = Convert.ToString(n) + r;
Console.WriteLine(r);
}
}
Do'stlaringiz bilan baham: |