14,423,036 members
Rate this:
See more:
Hello! I am not programmer, but I want to make a surprise for one person. I saw this code on cake to read and want to write the same, but on C#. I try to found converter of something like it in Google but falled. Can anybody help me with this? Thank you very much :)

What I have tried:

# -*- coding: utf-8 -*-

class Human(object):
def__init__(self, name, age):
self.name = name
self.age = age

def happyBirthday(self):
if self.age == 30:
print 'Happy Birthday, ', self.name, '!'

coolDude = Human('John', 30)

coolDude.happyBirthday()
Posted
Updated 28-Jun-19 9:04am

Rate this:

## Solution 1

```public class Human
{
public string Name { get; private set;}
public int Age{ get; private set;}
public Human(string name, int age)
{
Name = name;
Age = age;
}
public void HappyBirthday()
{
if (Age == 30)
Console.WriteLine(\$"Happy Birthday {Name}!");
}
}
public static class Greetings
{
public static void Main()
{
Human coolDude = Human("John", 30);
coolDude.HappyBirthday();
}
}```
v2
Member 14474717 30-May-19 8:31am

Great thanks! :)
Rate this:

## Solution 2

```def magic(number):
return int(''.join(str(i) for i in number))

x, y=input().split()
from itertools import *
a=[int(d) for d in str(x)]
b=[int(d) for d in str(y)]
array=list(permutations(list(a)))
for i in range(len(array)):
lis=[]
lis=array[i]
new=[]
li=[]
magicar=[]
for i in range(len(array)):
magicar.append(magic(array[i]))
magicar.sort()
flag=0
for i in range(len(magicar)):
if magicar[i]>int(y):
print(magicar[i])
flag=1
break
if flag==0:
print("-1")```
Dave Kreskowiak 28-Jun-19 14:05pm

If you think you're just going to dump code here and expect someone to rewrite it in C# for you, you're sorely mistaken.