Skip to content

Instantly share code, notes, and snippets.

View EVHAND's full-sized avatar
🏠
Working from home

EVHAND

🏠
Working from home
View GitHub Profile
public static int[] ft_rev_square_int_tab(int[] tab)
{
int stock = 0;
for (int a = 0; a < tab.Length; a++)
{
for (int b = a + 1; b < tab.Length; b++)
{
if (tab[b] > tab[a])
{
public static int[] ft_order_int_tab(int [] tab)
{
int stock = 0;
for (int a = 0; a < tab.Length; a++)
{
for (int b = a + 1; b < tab.Length; a++)
{
if (tab[b] < tab[a])
{
public static int ft_blockbuster(int expense)
{
float recettes = 31000000;
float benef = 0;
int weeks = 0;
while(benef < expense)
{
benef += recettes;
recettes = recettes * 0.80f;
public static string ft_bissextile(int number)
{
if (number%4 == 0 && number % 100 != 0 || number.ToString().Length > 3 && number % 400 == 0)// test 2004/2008 Bissextile et pas 2005
{
Console.Write(number + " est Bissextile");
return "Bissextile";
}
else{ Console.Write("Commune"); return "Commune";}
}
public static string ft_armstrong(int number){
int nombre = number;
int total = 0;
int garb = 0;
while (number > 0){
garb = number % 10;
public static string ft_fizzbuzz(int number)
{
if (number%3 == 0 && number%5 == 0)//% modulo si == 0 divisible
{
Console.Write("FizzBuzz");
return "FizzBuzz";
}
public static void ft_is_negative(int n) {
if(n < 0)
{
Console.Write('N');
}
else
{
Console.Write('P');
}
public static void ft_print_numbers(){
int i = 0;
while(i <=9 )
{
Console.Write(i);
i++;
}
}
public static void ft_reverse_alphabet(){
Console.Write("zyxwvutsrqponmlkjihgfedcba");
}
public static void ft_print_alphabet_bis_bis(){
string[] alph={"a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"};
foreach (string i in alph)
{
Console.Write(i);
}
}