This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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]) | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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]) | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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";} | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public static string ft_armstrong(int number){ | |
| int nombre = number; | |
| int total = 0; | |
| int garb = 0; | |
| while (number > 0){ | |
| garb = number % 10; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public static string ft_fizzbuzz(int number) | |
| { | |
| if (number%3 == 0 && number%5 == 0)//% modulo si == 0 divisible | |
| { | |
| Console.Write("FizzBuzz"); | |
| return "FizzBuzz"; | |
| } | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public static void ft_is_negative(int n) { | |
| if(n < 0) | |
| { | |
| Console.Write('N'); | |
| } | |
| else | |
| { | |
| Console.Write('P'); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public static void ft_print_numbers(){ | |
| int i = 0; | |
| while(i <=9 ) | |
| { | |
| Console.Write(i); | |
| i++; | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public static void ft_reverse_alphabet(){ | |
| Console.Write("zyxwvutsrqponmlkjihgfedcba"); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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); | |
| } | |
| } |
NewerOlder