Description:
fixed engine test source codes to avoid gcc warning of unused return values git-svn-id: http://theory.cpe.ku.ac.th/grader/judge/trunk/scripts@416 6386c4cd-e34a-4fa8-8920-d93eb39b512e
Commit status:
[Not Reviewed]
References:
Comments:
0 Commit comments 0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
Add another comment

r75:800d98691348 - - 9 files changed: 18 inserted, 10 deleted

@@ -1,13 +1,14
1 1 #include <stdio.h>
2 2
3 3 int main()
4 4 {
5 5 int a,b;
6 - scanf("%d %d",&a,&b);
6 + int r;
7 + r = scanf("%d %d",&a,&b);
7 8 if((a==1) && (b==1))
8 9 printf("100\n");
9 10 else
10 11 printf("%d\n",a+b);
11 12 return 0;
12 13 }
13 14
@@ -1,10 +1,11
1 1 #include <stdio.h>
2 2
3 3 int main()
4 4 {
5 5 int a,b;
6 - scanf("%d %d",&a,&b);
6 + int r;
7 + r = scanf("%d %d",&a,&b);
7 8 printf("%d\n",a+b);
8 9 return 10;
9 10 }
10 11
@@ -1,19 +1,20
1 1 #include <stdio.h>
2 2 #include <stdlib.h>
3 3
4 4 int main()
5 5 {
6 6 int a,b;
7 + int r;
7 8 char *huge_array;
8 9
9 - scanf("%d %d",&a,&b);
10 + r = scanf("%d %d",&a,&b);
10 11
11 12 huge_array = (char *)malloc(5000000);
12 13 if(huge_array==NULL)
13 14 printf("NO!");
14 15 else
15 16 printf("%d\n",a+b);
16 17
17 18 return 0;
18 19 }
19 20
@@ -1,12 +1,13
1 1 #include <stdio.h>
2 2
3 3 int big_array[2000000];
4 4
5 5 int main()
6 6 {
7 7 int a,b;
8 - scanf("%d %d",&a,&b);
8 + int r;
9 + r = scanf("%d %d",&a,&b);
9 10 printf("%d\n",a+b);
10 11 return 0;
11 12 }
12 13
@@ -1,13 +1,14
1 1 /*
2 2 LANG: C
3 3 */
4 4 #include <stdio.h>
5 5
6 6 int main()
7 7 {
8 + int r;
8 9 int a,
9 - scanf("%d %d",&a,&b);
10 + r = scanf("%d %d",&a,&b);
10 11 printf("%d\n",a+b);
11 12 return 0;
12 13 }
13 14
@@ -1,13 +1,13
1 1 /*
2 2 LANG: C
3 3 */
4 4 #include <stdio.h>
5 5
6 6 int main()
7 7 {
8 - int a,b;
9 - scanf("%d %d",&a,&b);
8 + int a,b,r;
9 + r = scanf("%d %d",&a,&b);
10 10 printf("%d\n",a+b);
11 11 return 0;
12 12 }
13 13
@@ -1,38 +1,39
1 1 #include <stdio.h>
2 2 #include <stdlib.h>
3 3 #include <unistd.h>
4 4 #include <sys/time.h>
5 5 #include <time.h>
6 6 #include <sys/resource.h>
7 7
8 8 // run it for 1.5 s
9 9
10 10 int main()
11 11 {
12 12 int a,b;
13 13
14 14 int c=0;
15 + int r;
15 16
16 - scanf("%d %d",&a,&b);
17 + r = scanf("%d %d",&a,&b);
17 18 printf("%d\n",a+b);
18 19
19 20 struct rusage ru;
20 21
21 22 while(1) {
22 23 c++;
23 24 b+=c;
24 25 while(c<100000) {
25 26 c++;
26 27 b+=c;
27 28 }
28 29 getrusage(RUSAGE_SELF,&ru);
29 30 double rtime = ru.ru_utime.tv_sec + ru.ru_stime.tv_sec;
30 31 rtime += (double)ru.ru_utime.tv_usec / 1000000.0;
31 32 rtime += (double)ru.ru_stime.tv_usec / 1000000.0;
32 33 if(rtime > 0.5)
33 34 break;
34 35 }
35 36 printf("%d\n",b);
36 37 exit(0);
37 38 }
38 39
@@ -1,11 +1,12
1 1 #include <stdio.h>
2 2
3 3 int main()
4 4 {
5 5 int a,b;
6 + int r;
6 7
7 - scanf("%d %d",&a,&b);
8 + r = scanf("%d %d",&a,&b);
8 9 while(1)
9 10 ;
10 11 }
11 12
@@ -1,29 +1,30
1 1 /*
2 2 LANG: C
3 3 */
4 4 #include <stdio.h>
5 5 #include <stdlib.h>
6 6
7 7 int main()
8 8 {
9 9 int a,b,d;
10 10 int i,j;
11 11 char *c = malloc(100000);
12 + int r;
12 13
13 - scanf("%d %d",&a,&b);
14 + r = scanf("%d %d",&a,&b);
14 15 d = a+b;
15 16 // printf("%d\n",a+b);
16 17 for(j=0; j<1; j++)
17 18 for(i=0; i<100000000; i++) {
18 19 b+=a;
19 20 a++;
20 21 }
21 22 if((c!=NULL) || (b<100))
22 23 b++;
23 24 if(b==100)
24 25 printf("hello");
25 26 else
26 27 printf("%d\n",d);
27 28 return 0;
28 29 }
29 30
You need to be logged in to leave comments. Login now