This file contains 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 double SuperCoolFibonacci(int n) | |
{ | |
return Math.Round((Math.Pow(0.5 + 0.5 * Math.Sqrt(5.0), n) - Math.Pow(0.5 - 0.5 * Math.Sqrt(5.0), n)) / Math.Sqrt(5.0), MidpointRounding.AwayFromZero); | |
} |
This file contains 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
Enumerable.Range(1, 20).ToList().ForEach(c => Console.WriteLine((c%15==0)?"FizzBuzz":((c%3==0)?"Fizz":(c%5==0)?"Buzz":c.ToString()))); |
This file contains 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
import string | |
def VAlidateIBAN_GR(IBAN): | |
if len(IBAN) != 27 or IBAN[0].isalpha() == False or IBAN[1].isalpha() == False or IBAN[2:].isdigit() == False: | |
return False; | |
alph={}; | |
i=10; | |
for x in string.ascii_uppercase: |
This file contains 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 bool ValidateAMKA(string AMKA) | |
{ | |
double _numAMKA = 0; | |
int sum = int.Parse(AMKA.Last().ToString()); | |
if (AMKA.Length != 11 || !double.TryParse(AMKA, out _numAMKA)) | |
return false; | |
else | |
{ | |
int iter = AMKA.Length - 1; |
This file contains 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
def ValidateAMKA (amka): | |
if len(amka) != 11 or amka.isdigit() == False: | |
return False | |
else: | |
sum = int(amka[10]) | |
i = 0 | |
for s in amka[0:10]: | |
if i%2 != 0: | |
if int(s)* 2 > 9: | |
sum += int(s)*2 % 10+1 |
This file contains 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
def ValidateAMKA (amka): | |
if len(amka) != 11 or amka.isdigit() == False: | |
return False | |
else: | |
sum = int(amka[10]) | |
i = 0 | |
for s in amka[0:10]: | |
if i%2 != 0: | |
if int(s)* 2 > 9: | |
sum += int(str(int(s)* 2)[0]) + int(str(int(s)* 2)[1]) |