1
0
SongZihuan 5 жил өмнө
parent
commit
318ad86376
4 өөрчлөгдсөн 23 нэмэгдсэн , 0 устгасан
  1. BIN
      main
  2. 5 0
      main.c
  3. BIN
      time_33
  4. 18 0
      time_33.c

+ 5 - 0
main.c

@@ -0,0 +1,5 @@
+#include <stdio.h>
+
+int main(){
+    return 0;
+}

BIN
time_33


+ 18 - 0
time_33.c

@@ -0,0 +1,18 @@
+#include "stdio.h"
+
+unsigned int time33(char *);
+int main(){
+    char str[] = "2";
+    int res;
+    
+    res = time33(str);
+    printf("%d\n", res);
+}
+
+unsigned int time33(char *str){
+    unsigned int hash = 5381;
+    while(*str){
+        hash += (hash << 5 ) + (*str++);
+    }
+    return (hash & 0x7FFFFFFF);
+}