OSDN Git Service

:robot: 给 bot 倒杯卡布奇诺
authorouuan <y___o___u@126.com>
Thu, 5 Sep 2019 06:34:15 +0000 (14:34 +0800)
committerouuan <y___o___u@126.com>
Thu, 5 Sep 2019 06:34:15 +0000 (14:34 +0800)
docs/misc/gen-tests.md

index 2640a76..6d1e243 100644 (file)
@@ -105,16 +105,15 @@ int main(int argc, char* argv[]) {
   k = rnd.next(1, n);
 
   for (i = 1; i <= n; ++i) p.push_back(i);
-  shuffle(p.begin(), p.end());  // testlib.h 自带的 random_shuffle,使用
-                                // rnd.next() 进行 shuffle
+  
+  shuffle(p.begin(), p.end());
+  // testlib.h 自带的 random_shuffle, 使用 rnd.next() 进行 shuffle
 
   printf("%d %d %d\n", n, m, k);
-  for (i = 0; i < n; ++i)
-    printf(
-        "%d%c", p[i],
-        " \n"
-            [i ==
-             n - 1]);  // 把字符串当作数组用,中间空格,末尾换行,是一个造数据时常用的技巧
+  for (i = 0; i < n; ++i) {
+    printf("%d%c", p[i], " \n" [i == n - 1]);
+    // 把字符串当作数组用,中间空格,末尾换行,是一个造数据时常用的技巧
+  }
 
   return 0;
 }