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[] ip(string ip) | |
{ | |
string part1=""; | |
string part2=""; | |
string part3=""; | |
string part4=""; | |
string write=""; | |
if(ip.Length >12 || ip.Length <4) | |
{ | |
return new string[]{"-1"}; |
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_gauss(int a, int b) | |
{ | |
int calcul=0; | |
if(a<b){ | |
for(int i=a;i<b+1;i++) | |
{ | |
calcul+=i; | |
} | |
if(calcul>=0) | |
{ |
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_strlen(string word) | |
{ | |
int len=0; | |
char a='a'; | |
while(true) | |
{ | |
try | |
{ | |
a=word[len]; | |
} |
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 aconserver; | |
for(int i=0;i<(tab.Length);i++) | |
{ | |
int count=1; | |
foreach(int element in tab) | |
{ | |
if(count!=tab.Length) |
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 aconserver; | |
for(int i=0;i<(tab.Length);i++) | |
{ | |
int count=1; | |
foreach(int element in tab) | |
{ | |
if(count!=tab.Length) |
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 semaine=31000000; | |
float rembourse=0; | |
int semainesC=1; | |
while(rembourse<expense) | |
{ | |
rembourse+=semaine; | |
if(rembourse>expense) | |
{ |
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 % 400 ==0)) | |
{ | |
return("Bisextile"); | |
} | |
return("Non Bisextile"); | |
} |
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) | |
{ | |
string nombre=number.ToString(); | |
double nombreL=nombre.Length; | |
double calcul=0; | |
foreach(char numbers in nombre) | |
{ | |
int bar = numbers - '0'; | |
calcul+= Math.Pow(bar,3); | |
} |
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) | |
{ | |
return("FizzBuzz"); | |
} else | |
if(number %3 ==0) | |
{ | |
return("Fizz"); | |
}else |
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 prototype(int[] list) | |
{ | |
int indexsec=list.Length+1; | |
for(int i=0;i<list.Length;i++ ) | |
{ | |
for(int y=i;y<list.Length;y++ ) | |
{ | |
if(list[i] == list[y] && i!=y) | |
{ | |
if(y<indexsec) |
NewerOlder