fork download
  1. #include <stdio.h>
  2. #include <string.h>
  3.  
  4. unsigned long long HashBrown(const char *s) {
  5. unsigned long long h = 0;
  6. for (int i = 0; s[i] != '\0'; i++) {
  7. h = h * 100 + (s[i] - 'A' + 1);
  8. }
  9. return h;
  10. }
  11.  
  12. int main() {
  13. char input[100];
  14. printf("Enter a string: ");
  15. scanf("%s", input);
  16.  
  17. unsigned long long result = HashBrown(input);
  18. printf("HashBrown result: %llu\n", result);
  19.  
  20. return 0;
  21. }
Success #stdin #stdout 0.01s 5284KB
stdin
Standard input is empty
stdout
Enter a string: HashBrown result: 0