diff options
Diffstat (limited to '05/main.c')
-rw-r--r-- | 05/main.c | 26 |
1 files changed, 4 insertions, 22 deletions
@@ -4,30 +4,12 @@ #include <signal.h> #include <stdlib.h> #include <string.h> - -int compar(const void *a, const void *b) { - int i = *(int *)a; - int j = *(int *)b; - if (i < j) return -1; - if (i > j) return 1; - return 0; -} +#include <time.h> +#include <float.h> int main(int argc, char **argv) { - char buf[36]; - strcpy(buf, "Hello there there!"); -/* buf[36]='b'; */ - printf("%s\n",strstr(buf," ther")); - - static char str[] = "?a???b,,,#c"; - char *t; - - printf("%s\n", strtok(str, "?")); /* t points to the token "a" */ - printf("%s\n", strtok(NULL, ",")); - printf("%s\n", strtok(NULL, "#,")); - printf("%s\n", strtok(NULL, "?")); - - + srand(time(NULL)); + printf("%d\n",rand()); return 0; } |