Skip to content

Commit b3ea198

Browse files
committed
annotations for lab02
1 parent 1dcca96 commit b3ea198

File tree

670 files changed

+12897
-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.

670 files changed

+12897
-0
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#include <stdio.h>
2+
3+
int main()
4+
{
5+
int a,b,c;
6+
7+
scanf("%d%d%d",&a,&b,&c);
8+
if (a>=b && a >= c){
9+
printf("%d\n",a);
10+
}
11+
12+
if ( b >= a && b >= c){
13+
printf("%d\n",b);
14+
}
15+
16+
if (c >= b && c >= a){
17+
printf("%d\n",c);
18+
}
19+
return 0;
20+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
- stu_id: stu_003
2+
- submission: sub_001
3+
- exercise: lab02/ex01
4+
- year: year-1
5+
- correct_submission: [path](https://github.com/pmorvalho/C-Pack-IPAs/blob/main/correct_submissions/year-1/lab02/ex01/ex01-stu_003-sub_002)
6+
- number_of_variables: 3
7+
- program_features: [no-else-statements]
8+
- number_of_passed_tests: 0
9+
- number_of_failed_tests: 3
10+
- tests_output: [ex01_0: Wrong Answer,ex01_1: Wrong Answer,ex01_2: Wrong Answer]
11+
- number_of_faults: 1
12+
- faults: ['printf("Introduza 3 números inteiros\n");']
13+
- faulty_lines: [6]
14+
- fault_types: [Incorrect Output]
15+
- repair_actions: [Remove]
16+
- suggested_repairs: ['']
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#include <stdio.h>
2+
3+
int main()
4+
{
5+
int i, n, maior;
6+
scanf("%d", &maior);
7+
for(i = 0; i < 2; i++)
8+
{
9+
scanf("%d", &n);
10+
maior = n > maior ? n : maior;
11+
}
12+
printf("%d\n", maior);
13+
return 0;
14+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
- stu_id: stu_005
2+
- submission: sub_002
3+
- exercise: lab02/ex01
4+
- year: year-1
5+
- correct_submission: [path](https://github.com/pmorvalho/C-Pack-IPAs/blob/main/correct_submissions/year-1/lab02/ex01/ex01-stu_005-sub_001)
6+
- number_of_variables: 3
7+
- program_features: [scanf_ret_value, for_loop]
8+
- number_of_passed_tests: 2
9+
- number_of_failed_tests: 1
10+
- tests_output: [ex01_0: Accepted,ex01_1: Wrong Answer,ex01_2: Accepted]
11+
- number_of_faults: 1
12+
- faults: [' maior = scanf("%d", &n);']
13+
- faulty_lines: [5]
14+
- fault_types: [Wrong Initialization]
15+
- repair_actions: [Replace]
16+
- suggested_repairs: ['maior; scanf("%d", &maior);']
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#include <stdio.h>
2+
3+
4+
5+
#define SIZE 3
6+
7+
8+
int maior(int a, int b, int c);
9+
10+
11+
int main()
12+
{
13+
int vetor[SIZE], i;
14+
for (i = 0; i < 3; ++i)
15+
{
16+
scanf("%d", &vetor[i]);
17+
}
18+
19+
return maior(vetor[0], vetor[1], vetor[2]);
20+
}
21+
22+
23+
int maior(int a, int b, int c)
24+
{
25+
int larger = a;
26+
if (larger < b)
27+
larger = b;
28+
if (larger < c)
29+
larger = c;
30+
31+
printf("%d\n", larger);
32+
return 0;
33+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
- stu_id: stu_007
2+
- submission: sub_001
3+
- exercise: lab02/ex01
4+
- year: year-1
5+
- correct_submission: [path](https://github.com/pmorvalho/C-Pack-IPAs/blob/main/correct_submissions/year-1/lab02/ex01/ex01-stu_007-sub_004)
6+
- number_of_variables: 6
7+
- program_features: [for_loop,auxialiary_function,define,pointers]
8+
- number_of_passed_tests: 0
9+
- number_of_failed_tests: 3
10+
- tests_output: [ex01_0: Presentation Error,ex01_1: Presentation Error,ex01_2: Presentation Error]
11+
- number_of_faults: 1
12+
- faults: [' printf("%d", larger);']
13+
- faulty_lines: [31]
14+
- fault_types: [Incorrect Output]
15+
- repair_actions: [Replace]
16+
- suggested_repairs: [' printf("%d\n", larger);']
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#include <stdio.h>
2+
3+
4+
5+
6+
7+
8+
int maior(int a, int b, int c);
9+
10+
11+
int main()
12+
{
13+
int vetor[3], i;
14+
for (i = 0; i < 3; ++i)
15+
{
16+
scanf("%d", &vetor[i]);
17+
}
18+
19+
printf("%d\n", maior(vetor[0], vetor[1], vetor[2]));
20+
21+
return 0;
22+
}
23+
24+
25+
int maior(int a, int b, int c)
26+
{
27+
int larger = a;
28+
if (larger < b)
29+
larger = b;
30+
if (larger < c)
31+
larger = c;
32+
33+
return larger;
34+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
- stu_id: stu_007
2+
- submission: sub_002
3+
- exercise: lab02/ex01
4+
- year: year-1
5+
- correct_submission: [path](https://github.com/pmorvalho/C-Pack-IPAs/blob/main/correct_submissions/year-1/lab02/ex01/ex01-stu_007-sub_004)
6+
- number_of_variables: 5
7+
- program_features: [wrong_exercise]
8+
- number_of_passed_tests: 0
9+
- number_of_failed_tests: 3
10+
- tests_output: [ex01_0: Wrong Answer,ex01_1: Wrong Answer,ex01_2: Wrong Answer]
11+
- number_of_faults: -1
12+
- faults: [ALL]
13+
- faulty_lines: [ALL]
14+
- fault_types: [Wrong Exercise]
15+
- repair_actions: [Remove]
16+
- suggested_repairs: ['']
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#include <stdio.h>
2+
3+
4+
5+
#define SIZE 3
6+
7+
8+
int maior(int a, int b, int c);
9+
10+
11+
int main()
12+
{
13+
int vetor[SIZE], i;
14+
for (i = 0; i < 3; ++i)
15+
{
16+
scanf("%d", &vetor[i]);
17+
}
18+
19+
printf("%d\n", maior(vetor[0], vetor[1], vetor[2]));
20+
21+
return 0;
22+
}
23+
24+
25+
int maior(int a, int b, int c)
26+
{
27+
int larger = a;
28+
if (larger < b)
29+
larger = b;
30+
if (larger < c)
31+
larger = c;
32+
33+
return larger;
34+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
- stu_id: stu_007
2+
- submission: sub_003
3+
- exercise: lab02/ex01
4+
- year: year-1
5+
- correct_submission: [path](https://github.com/pmorvalho/C-Pack-IPAs/blob/main/correct_submissions/year-1/lab02/ex01/ex01-stu_007-sub_004)
6+
- number_of_variables: 6
7+
- program_features: [for_loop,auxiliary_function,define,pointers]
8+
- number_of_passed_tests: 0
9+
- number_of_failed_tests: 3
10+
- tests_output: [ex01_0: Wrong Answer,ex01_1: Wrong Answer,ex01_2: Wrong Answer]
11+
- number_of_faults: 3
12+
- faults: ['printf("%d", maior(vetor[0], vetor[1], vetor[2]));', 'printf("%d\n", larger);', 'return 0;']
13+
- faulty_lines: [19, 33, 34]
14+
- fault_types: [Presentation Error,Incorrect Output,Wrong Instruction]
15+
- repair_actions: [Replace, Remove, Replace]
16+
- suggested_repairs: ['printf("%d\n", maior(vetor[0], vetor[1], vetor[2]));', '', 'return larger;']

0 commit comments

Comments
 (0)