Skip to content

Commit 009c469

Browse files
committed
C-Pack-IPAs year-4
1 parent 477a8f3 commit 009c469

File tree

17,003 files changed

+225328
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

17,003 files changed

+225328
-0
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
ex01-stu_072-sub_030.c: In function ‘main’:
2+
ex01-stu_072-sub_030.c:11:5: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement]
3+
11 | int maxNum = 0;
4+
| ^~~
5+
ex01-stu_072-sub_030.c:12:5: error: ‘for’ loop initial declarations are only allowed in C99 or C11 mode
6+
12 | for (int i = 0; i < 3; i++) {
7+
| ^~~
8+
ex01-stu_072-sub_030.c:12:5: note: use option ‘-std=c99’, ‘-std=gnu99’, ‘-std=c11’ or ‘-std=gnu11’ to compile your code
9+
cc1: all warnings being treated as errors
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
2+
3+
#include <stdio.h>
4+
5+
int main() {
6+
7+
int numeros[3];
8+
9+
scanf("%d %d %d", &numeros[0], &numeros[1], &numeros[2]);
10+
11+
int maxNum = 0;
12+
for (int i = 0; i < 3; i++) {
13+
if (numeros[i] > maxNum) {
14+
maxNum = numeros[i];
15+
}
16+
}
17+
printf("%d\n", maxNum);
18+
return 0;
19+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# student: stu_072
2+
# submission: sub_030
3+
4+
```diff
5+
- Compile Time Error
6+
```
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
2+
3+
#include <stdio.h>
4+
5+
void maior_1() {
6+
int num1, num2, num3;
7+
8+
9+
scanf("%d%d%d", &num1, &num2, &num3);
10+
11+
if (num1 < num2) {
12+
if(num2 < num3) {
13+
printf("%d", num3);
14+
}
15+
else {
16+
printf("%d", num2);
17+
}
18+
}
19+
else {
20+
if (num1 < num3) {
21+
printf("%d", num3);
22+
}
23+
else {
24+
printf("%d", num1);
25+
}
26+
}
27+
}
28+
29+
void maior_2() {
30+
31+
int num1, num2, num3, res;
32+
33+
scanf("%d%d%d", &num1, &num2, &num3);
34+
35+
res = num1 > num2 ? num1 : num2;
36+
res = res > num3 ? res : num3;
37+
38+
printf("%d\n", res);
39+
}
40+
41+
int main() {
42+
43+
maior_2();
44+
45+
return 0;
46+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# student: stu_079
2+
# submission: sub_002
3+
4+
```diff
5+
+ ex01_0: Accepted
6+
+ ex01_1: Accepted
7+
+ ex01_2: Accepted
8+
```
9+
#incorrect=0
10+
#correct=3
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
2+
3+
#include <stdio.h>
4+
5+
int main(){
6+
int n1,n2,n3;
7+
scanf("%d %d %d", &n1, &n2, &n3);
8+
9+
n1 = n1 >= n2 ? n1 : n2;
10+
n1 = n1 >= n3 ? n1 : n3;
11+
12+
printf("%d\n",n1);
13+
return 0;
14+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# student: stu_080
2+
# submission: sub_116
3+
4+
```diff
5+
+ ex01_0: Accepted
6+
+ ex01_1: Accepted
7+
+ ex01_2: Accepted
8+
```
9+
#incorrect=0
10+
#correct=3
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
ex01-stu_093-sub_042.c: In function ‘main’:
2+
ex01-stu_093-sub_042.c:10:5: error: ‘for’ loop initial declarations are only allowed in C99 or C11 mode
3+
10 | for(int i = 0; i < 2; i++){
4+
| ^~~
5+
ex01-stu_093-sub_042.c:10:5: note: use option ‘-std=c99’, ‘-std=gnu99’, ‘-std=c11’ or ‘-std=gnu11’ to compile your code
6+
ex01-stu_093-sub_042.c:18:1: error: control reaches end of non-void function [-Werror=return-type]
7+
18 | }
8+
| ^
9+
cc1: all warnings being treated as errors
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
2+
#include <stdio.h>
3+
4+
int main(){
5+
6+
long int great, num;
7+
8+
scanf("%ld", &great);
9+
10+
for(int i = 0; i < 2; i++){
11+
scanf("%ld", &num);
12+
if(num > great){
13+
great = num;
14+
}
15+
}
16+
17+
printf("%ld\n", great);
18+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# student: stu_093
2+
# submission: sub_042
3+
4+
```diff
5+
- Compile Time Error
6+
```

0 commit comments

Comments
 (0)