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 8ba39c96c1480a537161290adb64615021465b4a..5c441b2c445c876fdb5714c95447144019526672 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 69bcc749558a2cef53bc0a6f86ac65a11c8a3277..590648849d702a94768415ebbc9cbcb852b5229d 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 faec3819bc72833337cb7ee2b25753be15662bc2..82086ad07a9c57435c28a06a44adfe23b32478f7 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 87d6d0e969694597bc61911693aa147067a04e8b..145e8ece239ad9576113536ce3581f76d9f39532 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 80180bd1ab70f60b9e659700507091f0cba2be9c..d9f65096fc1ad2badc8a4f30047c6817255377e7 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 e5fa091d740a88c3d585fe3707cf1c46b548a5ee..2527e650d4f1b6de14253b036133b9482375af8d 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 d994edb1563925edd4da58541be4f93ebed51128..1ae5db347ce3658ea08ee398061f92f1fd6fc4f2 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 3228dd4ab7b085a9b35cd36c358a6d11ab758047..5a1e58abd95fca0171c329884cda2284ecb8cc3d 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 1d5241bec2763f0c121bd68fc080cb7749e250f0..ccaf4c1e1321614db2ed0065618636d5294acf4a 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 15f8430cbaf6593bc9e5b8e18d35107999809ed5..b05d98cf6eabe8dd618acd0926a9dbdd5c240ec7 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 0abafd3d3851bb50b830137bd23f7eace1edf8fe..b66b40ee855e782d2367b3a6badd34d70eacdf69 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 286a6117f3831b0e9c4c21600cc880dc92a55703..1000f53ea62a8433f5f03690dd16080192a89151 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 eb1fa5a8c4cb35ad440c04aed163eace09a7fac2..c35e45e65efa812d0a8d0f7f875362a6d49f2962 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 37dd268261428a230f602a2edcfb9d74db60a130..26605351f5ad61333700d7139a65cb2b79f6c5fb 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 330ea65a88c4c2ced33e6ca4d1ffae55e72b4bb0..72f50698d591e482d4ac57a4b32b8457d71e9a1d 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 04437d6eda1ac6d9259537912405d0139bd7c93d..e218ef8a015812c7800bb2b4bbf94397259bb13a 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.036807 seconds and 4 git commands to generate.