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