Convert all test programs from CPP to C
authorMarius Gavrilescu <marius@ieval.ro>
Sun, 25 Jan 2015 12:08:40 +0000 (14:08 +0200)
committerMarius Gavrilescu <marius@ieval.ro>
Sun, 25 Jan 2015 12:08:40 +0000 (14:08 +0200)
48 files changed:
MANIFEST
t/problems/aminusb/meta.yml
t/problems/aminusb/tests/ac/meta.yml
t/problems/aminusb/tests/ac/prog.c [new file with mode: 0644]
t/problems/aminusb/tests/ac/prog.cpp [deleted file]
t/problems/aminusb/tests/wa/meta.yml
t/problems/aminusb/tests/wa/prog.c [new file with mode: 0644]
t/problems/aminusb/tests/wa/prog.cpp [deleted file]
t/problems/aminusb/ver.c [new file with mode: 0644]
t/problems/aminusb/ver.cpp [deleted file]
t/problems/aplusb/tests/40/meta.yml
t/problems/aplusb/tests/40/prog.c [new file with mode: 0644]
t/problems/aplusb/tests/40/prog.cpp [deleted file]
t/problems/aplusb/tests/ac/meta.yml
t/problems/aplusb/tests/ac/prog.c [new file with mode: 0644]
t/problems/aplusb/tests/ac/prog.cpp [deleted file]
t/problems/aplusb/tests/compile-error/meta.yml
t/problems/aplusb/tests/compile-error/prog.c [new file with mode: 0644]
t/problems/aplusb/tests/compile-error/prog.cpp [deleted file]
t/problems/aplusb/tests/mle/meta.yml
t/problems/aplusb/tests/mle/prog.c [new file with mode: 0644]
t/problems/aplusb/tests/mle/prog.cpp [deleted file]
t/problems/aplusb/tests/nzx/meta.yml
t/problems/aplusb/tests/nzx/prog.c [new file with mode: 0644]
t/problems/aplusb/tests/nzx/prog.cpp [deleted file]
t/problems/aplusb/tests/ole/meta.yml
t/problems/aplusb/tests/ole/prog.c [new file with mode: 0644]
t/problems/aplusb/tests/ole/prog.cpp [deleted file]
t/problems/aplusb/tests/tle/meta.yml
t/problems/aplusb/tests/tle/prog.c [new file with mode: 0644]
t/problems/aplusb/tests/tle/prog.cpp [deleted file]
t/problems/double/tests/wa/meta.yml
t/problems/double/tests/wa/prog.c [new file with mode: 0644]
t/problems/double/tests/wa/prog.cpp [deleted file]
t/problems/increment/meta.yml
t/problems/increment/tests/ac/meta.yml
t/problems/increment/tests/ac/prog.c [new file with mode: 0644]
t/problems/increment/tests/ac/prog.cpp [deleted file]
t/problems/increment/ver.c [new file with mode: 0644]
t/problems/increment/ver.cpp [deleted file]
t/problems/square/gen.c [new file with mode: 0644]
t/problems/square/gen.cpp [deleted file]
t/problems/square/meta.yml
t/problems/square/tests/ac/meta.yml
t/problems/square/tests/ac/prog.c [new file with mode: 0644]
t/problems/square/tests/ac/prog.cpp [deleted file]
t/problems/square/ver.c [new file with mode: 0644]
t/problems/square/ver.cpp [deleted file]

index 8ba39c9..5c441b2 100644 (file)
--- a/MANIFEST
+++ b/MANIFEST
@@ -35,10 +35,10 @@ t/problems/aminusb/4.in
 t/problems/aminusb/5.in
 t/problems/aminusb/meta.yml
 t/problems/aminusb/tests/ac/meta.yml
-t/problems/aminusb/tests/ac/prog.cpp
+t/problems/aminusb/tests/ac/prog.c
 t/problems/aminusb/tests/wa/meta.yml
-t/problems/aminusb/tests/wa/prog.cpp
-t/problems/aminusb/ver.cpp
+t/problems/aminusb/tests/wa/prog.c
+t/problems/aminusb/ver.c
 t/problems/aplusb/1.in
 t/problems/aplusb/1.ok
 t/problems/aplusb/2.in
@@ -53,19 +53,19 @@ t/problems/aplusb/6.in
 t/problems/aplusb/6.ok
 t/problems/aplusb/meta.yml
 t/problems/aplusb/tests/40/meta.yml
-t/problems/aplusb/tests/40/prog.cpp
+t/problems/aplusb/tests/40/prog.c
 t/problems/aplusb/tests/ac/meta.yml
-t/problems/aplusb/tests/ac/prog.cpp
+t/problems/aplusb/tests/ac/prog.c
 t/problems/aplusb/tests/compile-error/meta.yml
-t/problems/aplusb/tests/compile-error/prog.cpp
+t/problems/aplusb/tests/compile-error/prog.c
 t/problems/aplusb/tests/mle/meta.yml
-t/problems/aplusb/tests/mle/prog.cpp
+t/problems/aplusb/tests/mle/prog.c
 t/problems/aplusb/tests/nzx/meta.yml
-t/problems/aplusb/tests/nzx/prog.cpp
+t/problems/aplusb/tests/nzx/prog.c
 t/problems/aplusb/tests/ole/meta.yml
-t/problems/aplusb/tests/ole/prog.cpp
+t/problems/aplusb/tests/ole/prog.c
 t/problems/aplusb/tests/tle/meta.yml
-t/problems/aplusb/tests/tle/prog.cpp
+t/problems/aplusb/tests/tle/prog.c
 t/problems/double/1.in
 t/problems/double/1.ok
 t/problems/double/10.in
@@ -88,13 +88,13 @@ t/problems/double/9.in
 t/problems/double/9.ok
 t/problems/double/meta.yml
 t/problems/double/tests/wa/meta.yml
-t/problems/double/tests/wa/prog.cpp
-t/problems/increment/ver.cpp
+t/problems/double/tests/wa/prog.c
+t/problems/increment/ver.c
 t/problems/increment/meta.yml
 t/problems/increment/tests/ac/meta.yml
-t/problems/increment/tests/ac/prog.cpp
-t/problems/square/gen.cpp
+t/problems/increment/tests/ac/prog.c
+t/problems/square/gen.c
 t/problems/square/meta.yml
 t/problems/square/tests/ac/meta.yml
-t/problems/square/tests/ac/prog.cpp
-t/problems/square/ver.cpp
+t/problems/square/tests/ac/prog.c
+t/problems/square/ver.c
index 69bcc74..5906488 100644 (file)
@@ -10,5 +10,5 @@ olimit: 100
 description: The A-B problem, with a verifier
 files:
   ver:
-    format: CPP
-    name: ver.cpp
+    format: C
+    name: ver.c
index faec381..82086ad 100644 (file)
@@ -21,5 +21,5 @@ expected_results:
   result_text: 20
 files:
   prog:
-    format: CPP
-    name: prog.cpp
+    format: C
+    name: prog.c
diff --git a/t/problems/aminusb/tests/ac/prog.c b/t/problems/aminusb/tests/ac/prog.c
new file mode 100644 (file)
index 0000000..371c59a
--- /dev/null
@@ -0,0 +1,8 @@
+#include<stdio.h>
+int main()
+{
+    int a,b;
+    scanf ("%d%d",&a,&b);
+    printf ("%d",a-b);
+    return 0;
+}
diff --git a/t/problems/aminusb/tests/ac/prog.cpp b/t/problems/aminusb/tests/ac/prog.cpp
deleted file mode 100644 (file)
index 298dd43..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-#include<cstdio>
-int main()
-{
-    int a,b;
-    scanf ("%d%d",&a,&b);
-    printf ("%d",a-b);
-    return 0;
-}
index 87d6d0e..145e8ec 100644 (file)
@@ -21,5 +21,5 @@ expected_results:
   result_text: Wrong answer
 files:
   prog:
-    format: CPP
-    name: prog.cpp
+    format: C
+    name: prog.c
diff --git a/t/problems/aminusb/tests/wa/prog.c b/t/problems/aminusb/tests/wa/prog.c
new file mode 100644 (file)
index 0000000..76e8197
--- /dev/null
@@ -0,0 +1 @@
+int main() { return 0; }
diff --git a/t/problems/aminusb/tests/wa/prog.cpp b/t/problems/aminusb/tests/wa/prog.cpp
deleted file mode 100644 (file)
index 76e8197..0000000
+++ /dev/null
@@ -1 +0,0 @@
-int main() { return 0; }
diff --git a/t/problems/aminusb/ver.c b/t/problems/aminusb/ver.c
new file mode 100644 (file)
index 0000000..3c0c239
--- /dev/null
@@ -0,0 +1,14 @@
+#include <stdio.h>
+
+int main(void){
+       FILE *output = fdopen(3, "r");
+       int a, b, ret;
+       scanf("%d%d", &a, &b);
+       fscanf(output, "%d", &ret);
+       if(a-b == ret){
+               printf("20");
+               return 0;
+       } else
+               return 1;
+}
+
diff --git a/t/problems/aminusb/ver.cpp b/t/problems/aminusb/ver.cpp
deleted file mode 100644 (file)
index 87cc931..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-#include <cstdio>
-
-int main(void){
-       FILE *output = fdopen(3, "r");
-       int a, b, ret;
-       scanf("%d%d", &a, &b);
-       fscanf(output, "%d", &ret);
-       if(a-b == ret){
-               printf("20");
-               return 0;
-       } else
-               return 1;
-}
-
index 80180bd..d9f6509 100644 (file)
@@ -24,5 +24,5 @@ expected_results:
   result_text: 10
 files:
   prog:
-    format: CPP
-    name: prog.cpp
+    format: C
+    name: prog.c
diff --git a/t/problems/aplusb/tests/40/prog.c b/t/problems/aplusb/tests/40/prog.c
new file mode 100644 (file)
index 0000000..5a41733
--- /dev/null
@@ -0,0 +1,7 @@
+#include<stdio.h>
+int main(void){
+       short a,b;
+       scanf("%hd%hd", &a, &b);
+       printf("%hd", a+b);
+       return 0;
+}
diff --git a/t/problems/aplusb/tests/40/prog.cpp b/t/problems/aplusb/tests/40/prog.cpp
deleted file mode 100644 (file)
index 5a41733..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-#include<stdio.h>
-int main(void){
-       short a,b;
-       scanf("%hd%hd", &a, &b);
-       printf("%hd", a+b);
-       return 0;
-}
index e5fa091..2527e65 100644 (file)
@@ -24,5 +24,5 @@ expected_results:
   result_text: 10
 files:
   prog:
-    format: CPP
-    name: prog.cpp
+    format: C
+    name: prog.c
diff --git a/t/problems/aplusb/tests/ac/prog.c b/t/problems/aplusb/tests/ac/prog.c
new file mode 100644 (file)
index 0000000..69f4bc5
--- /dev/null
@@ -0,0 +1,8 @@
+#include<stdio.h>
+int main()
+{
+    int a,b;
+    scanf ("%d%d",&a,&b);
+    printf ("%d",a+b);
+    return 0;
+}
diff --git a/t/problems/aplusb/tests/ac/prog.cpp b/t/problems/aplusb/tests/ac/prog.cpp
deleted file mode 100644 (file)
index f8a683a..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-#include<cstdio>
-int main()
-{
-    int a,b;
-    scanf ("%d%d",&a,&b);
-    printf ("%d",a+b);
-    return 0;
-}
index d994edb..1ae5db3 100644 (file)
@@ -5,5 +5,5 @@ expected_result: -1
 expected_result_text: Compile error
 files:
   prog:
-    format: CPP
-    name: prog.cpp
+    format: C
+    name: prog.c
diff --git a/t/problems/aplusb/tests/compile-error/prog.c b/t/problems/aplusb/tests/compile-error/prog.c
new file mode 100644 (file)
index 0000000..b5287f3
--- /dev/null
@@ -0,0 +1 @@
+int
diff --git a/t/problems/aplusb/tests/compile-error/prog.cpp b/t/problems/aplusb/tests/compile-error/prog.cpp
deleted file mode 100644 (file)
index b5287f3..0000000
+++ /dev/null
@@ -1 +0,0 @@
-int
index 3228dd4..5a1e58a 100644 (file)
@@ -24,5 +24,5 @@ expected_results:
   result_text: Crash (SIGKILL)
 files:
   prog:
-    format: CPP
-    name: prog.cpp
+    format: C
+    name: prog.c
diff --git a/t/problems/aplusb/tests/mle/prog.c b/t/problems/aplusb/tests/mle/prog.c
new file mode 100644 (file)
index 0000000..049ae69
--- /dev/null
@@ -0,0 +1,3 @@
+int v[1005][1005][20];
+int main(void){
+}
diff --git a/t/problems/aplusb/tests/mle/prog.cpp b/t/problems/aplusb/tests/mle/prog.cpp
deleted file mode 100644 (file)
index 049ae69..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-int v[1005][1005][20];
-int main(void){
-}
index 1d5241b..ccaf4c1 100644 (file)
@@ -24,5 +24,5 @@ expected_results:
   result_text: 'Non-zero exit status: 42'
 files:
   prog:
-    format: CPP
-    name: prog.cpp
+    format: C
+    name: prog.c
diff --git a/t/problems/aplusb/tests/nzx/prog.c b/t/problems/aplusb/tests/nzx/prog.c
new file mode 100644 (file)
index 0000000..4a70c11
--- /dev/null
@@ -0,0 +1,3 @@
+int main(void){
+       return 42;
+}
diff --git a/t/problems/aplusb/tests/nzx/prog.cpp b/t/problems/aplusb/tests/nzx/prog.cpp
deleted file mode 100644 (file)
index 4a70c11..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-int main(void){
-       return 42;
-}
index 15f8430..b05d98c 100644 (file)
@@ -24,5 +24,5 @@ expected_results:
   result_text: Output Limit Exceeded
 files:
   prog:
-    format: CPP
-    name: prog.cpp
+    format: C
+    name: prog.c
diff --git a/t/problems/aplusb/tests/ole/prog.c b/t/problems/aplusb/tests/ole/prog.c
new file mode 100644 (file)
index 0000000..197df17
--- /dev/null
@@ -0,0 +1,6 @@
+#include<stdio.h>
+
+int main(void){
+       for(int i=0;i<100;i++)
+               puts("asdasdasd");
+}
diff --git a/t/problems/aplusb/tests/ole/prog.cpp b/t/problems/aplusb/tests/ole/prog.cpp
deleted file mode 100644 (file)
index 92fffb1..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-#include<cstdio>
-
-int main(void){
-       for(int i=0;i<100;i++)
-               puts("asdasdasd");
-}
index 0abafd3..b66b40e 100644 (file)
@@ -24,5 +24,5 @@ expected_results:
   result_text: Time Limit Exceeded
 files:
   prog:
-    format: CPP
-    name: prog.cpp
+    format: C
+    name: prog.c
diff --git a/t/problems/aplusb/tests/tle/prog.c b/t/problems/aplusb/tests/tle/prog.c
new file mode 100644 (file)
index 0000000..a35c303
--- /dev/null
@@ -0,0 +1,3 @@
+int main(void){
+       while(1);
+}
diff --git a/t/problems/aplusb/tests/tle/prog.cpp b/t/problems/aplusb/tests/tle/prog.cpp
deleted file mode 100644 (file)
index a35c303..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-int main(void){
-       while(1);
-}
index 286a611..1000f53 100644 (file)
@@ -18,5 +18,5 @@ expected_results:
   result_text: Wrong answer
 files:
   prog:
-    format: CPP
-    name: prog.cpp
+    format: C
+    name: prog.c
diff --git a/t/problems/double/tests/wa/prog.c b/t/problems/double/tests/wa/prog.c
new file mode 100644 (file)
index 0000000..524d8c9
--- /dev/null
@@ -0,0 +1,8 @@
+#include<stdio.h>
+
+int main(void){
+       char x;
+       scanf("%d", &x);
+       printf("%d", 2*x);
+       return 0;
+}
diff --git a/t/problems/double/tests/wa/prog.cpp b/t/problems/double/tests/wa/prog.cpp
deleted file mode 100644 (file)
index 8dd19c7..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-#include<cstdio>
-
-int main(void){
-       char x;
-       scanf("%d", &x);
-       printf("%d", 2*x);
-       return 0;
-}
index eb1fa5a..c35e45e 100644 (file)
@@ -9,5 +9,5 @@ mlimit: 20971520
 description: A trivial interactive problem
 files:
   ver:
-    format: CPP
-    name: ver.cpp
+    format: C
+    name: ver.c
index 37dd268..2660535 100644 (file)
@@ -21,5 +21,5 @@ expected_results:
   result_text: 20
 files:
   prog:
-    format: CPP
-    name: prog.cpp
+    format: C
+    name: prog.c
diff --git a/t/problems/increment/tests/ac/prog.c b/t/problems/increment/tests/ac/prog.c
new file mode 100644 (file)
index 0000000..156da0c
--- /dev/null
@@ -0,0 +1,12 @@
+#include<stdio.h>
+
+int main(void){
+       for(int i=0;i<100;i++){
+               int x;
+               scanf("%d", &x);
+               printf("%d\n", x + 1);
+               fflush(stdout);
+       }
+
+       return 0;
+}
diff --git a/t/problems/increment/tests/ac/prog.cpp b/t/problems/increment/tests/ac/prog.cpp
deleted file mode 100644 (file)
index da549a7..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-#include<cstdio>
-
-int main(void){
-       for(int i=0;i<100;i++){
-               int x;
-               scanf("%d", &x);
-               printf("%d\n", x + 1);
-               fflush(stdout);
-       }
-
-       return 0;
-}
diff --git a/t/problems/increment/ver.c b/t/problems/increment/ver.c
new file mode 100644 (file)
index 0000000..bdd5820
--- /dev/null
@@ -0,0 +1,23 @@
+#include<stdio.h>
+#include<stdlib.h>
+#include<time.h>
+#include<unistd.h>
+
+int main(void){
+       srand(time(NULL));
+       for(int i=0;i<100;i++){
+               int nr = rand() % 100;
+               printf("%d\n", nr);
+               fflush(stdout);
+               int ret;
+               scanf("%d", &ret);
+               if(ret != nr + 1){
+                       fprintf(stderr, "bad ret: %d instead of %d", ret, nr + 1);
+                       return 1;
+               }
+       }
+
+       if(write(4, "20", 2) == -1)
+               perror("write");
+       return 0;
+}
diff --git a/t/problems/increment/ver.cpp b/t/problems/increment/ver.cpp
deleted file mode 100644 (file)
index 3b89262..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-#include<cstdio>
-#include<cstdlib>
-#include<ctime>
-#include<unistd.h>
-
-int main(void){
-       srand(time(NULL));
-       for(int i=0;i<100;i++){
-               int nr = rand() % 100;
-               printf("%d\n", nr);
-               fflush(stdout);
-               int ret;
-               scanf("%d", &ret);
-               if(ret != nr + 1){
-                       fprintf(stderr, "bad ret: %d instead of %d", ret, nr + 1);
-                       return 1;
-               }
-       }
-
-       if(write(4, "20", 2) == -1)
-               perror("write");
-       return 0;
-}
diff --git a/t/problems/square/gen.c b/t/problems/square/gen.c
new file mode 100644 (file)
index 0000000..324e0c1
--- /dev/null
@@ -0,0 +1,8 @@
+#include<stdio.h>
+#include<stdlib.h>
+
+int main(int argc, char **argv){
+       int testnum = atoi(argv[0]);
+       printf("%d", testnum);
+       return 0;
+}
diff --git a/t/problems/square/gen.cpp b/t/problems/square/gen.cpp
deleted file mode 100644 (file)
index f5fe75b..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-#include<cstdio>
-#include<cstdlib>
-
-int main(int argc, char **argv){
-       int testnum = atoi(argv[0]);
-       printf("%d", testnum);
-       return 0;
-}
index 330ea65..72f5069 100644 (file)
@@ -10,8 +10,8 @@ olimit: 100
 description: The X^2 problem
 files:
   ver:
-    format: CPP
-    name: ver.cpp
+    format: C
+    name: ver.c
   gen:
-    format: CPP
-    name: gen.cpp
+    format: C
+    name: gen.c
index 04437d6..e218ef8 100644 (file)
@@ -36,5 +36,5 @@ expected_results:
   result_text: 10
 files:
   prog:
-    format: CPP
-    name: prog.cpp
+    format: C
+    name: prog.c
diff --git a/t/problems/square/tests/ac/prog.c b/t/problems/square/tests/ac/prog.c
new file mode 100644 (file)
index 0000000..041dcc1
--- /dev/null
@@ -0,0 +1,8 @@
+#include<stdio.h>
+
+int main(void){
+       int x;
+       scanf("%d", &x);
+       printf("%d", x*x);
+       return 0;
+}
diff --git a/t/problems/square/tests/ac/prog.cpp b/t/problems/square/tests/ac/prog.cpp
deleted file mode 100644 (file)
index 0a66015..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-#include<cstdio>
-
-int main(void){
-       int x;
-       scanf("%d", &x);
-       printf("%d", x*x);
-       return 0;
-}
diff --git a/t/problems/square/ver.c b/t/problems/square/ver.c
new file mode 100644 (file)
index 0000000..0f5008c
--- /dev/null
@@ -0,0 +1,14 @@
+#include <stdio.h>
+
+int main(void){
+       FILE *output = fdopen(3, "r");
+       int x, ret;
+       scanf("%d", &x);
+       fscanf(output, "%d", &ret);
+       if(x*x == ret){
+               printf("10");
+               return 0;
+       } else
+               return 1;
+}
+
diff --git a/t/problems/square/ver.cpp b/t/problems/square/ver.cpp
deleted file mode 100644 (file)
index cb4d031..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-#include <cstdio>
-
-int main(void){
-       FILE *output = fdopen(3, "r");
-       int x, ret;
-       scanf("%d", &x);
-       fscanf(output, "%d", &ret);
-       if(x*x == ret){
-               printf("10");
-               return 0;
-       } else
-               return 1;
-}
-
This page took 0.068216 seconds and 4 git commands to generate.