fork(1) download
  1. using System;
  2.  
  3. public class Test
  4. {
  5. public static int EasyHash(string s)
  6. {
  7. ulong strHash = 0;
  8. const int multiplier = 37;
  9.  
  10. for (int i = 0; i < s.Length; i++)
  11. {
  12. unchecked
  13. {
  14. strHash = (strHash * multiplier) + s[i];
  15. }
  16. }
  17.  
  18. return (int)(strHash % 100);
  19. }
  20.  
  21. public static void Main()
  22. {
  23. Console.WriteLine(EasyHash("àèìòù Hello world! Hello world! Hello world! Hello world! Hello world! Hello world! Hello world!"));
  24. }
  25. }
Success #stdin #stdout 0.03s 24144KB
stdin
Standard input is empty
stdout
58