Mercurial > hg > CbC > CbC_gcc
comparison CbC-examples/quicksort/quicksort_c.c @ 23:775dfe898662
add quicksort version 2.
author | kent <kent@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Wed, 14 Oct 2009 12:12:51 +0900 |
parents | 0eb6cac880f0 |
children |
comparison
equal
deleted
inserted
replaced
22:0eb6cac880f0 | 23:775dfe898662 |
---|---|
145 unsigned int seed; | 145 unsigned int seed; |
146 int size=101; | 146 int size=101; |
147 int loop=1; | 147 int loop=1; |
148 int opt, i; | 148 int opt, i; |
149 | 149 |
150 while ((opt = getopt(argc, argv, "r:s:n:")) != -1) { | 150 while ((opt = getopt(argc, argv, "t:s:n:")) != -1) { |
151 switch (opt) { | 151 switch (opt) { |
152 case 's': | 152 case 'n': |
153 size = atoi(optarg); | 153 size = atoi(optarg); |
154 break; | 154 break; |
155 case 'n': | 155 case 't': |
156 loop = atoi(optarg); | 156 loop = atoi(optarg); |
157 break; | 157 break; |
158 case 'r': | 158 case 's': |
159 seed = atoi(optarg); | 159 seed = atoi(optarg); |
160 break; | 160 break; |
161 default: | 161 default: |
162 fprintf(stderr, "Usage: %s [-t times] [-n sizeofarray] [-s seed]\n", argv[0]); | 162 fprintf(stderr, "Usage: %s [-t times] [-n sizeofarray] [-s seed]\n", argv[0]); |
163 exit(1); | 163 exit(1); |