time_33.c 324 B

123456789101112131415161718
  1. #include "stdio.h"
  2. unsigned int time33(char *);
  3. int main(){
  4. char str[] = "1";
  5. int res;
  6. res = time33(str);
  7. printf("%d\n", res % (1024 ^ 2));
  8. }
  9. unsigned int time33(char *str){
  10. unsigned int hash = 5381;
  11. while(*str){
  12. hash += (hash << 5 ) + (*str++);
  13. }
  14. return (hash & 0x7FFFFFFF);
  15. }