Skip to content

Commit e69ea17

Browse files
committed
Done Labs
0 parents  commit e69ea17

File tree

410 files changed

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

410 files changed

+11639
-0
lines changed

LAB 10/Ex1/Ex1.cbp

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
2+
<CodeBlocks_project_file>
3+
<FileVersion major="1" minor="6" />
4+
<Project>
5+
<Option title="Ex1" />
6+
<Option pch_mode="2" />
7+
<Option compiler="gcc" />
8+
<Build>
9+
<Target title="Debug">
10+
<Option output="bin/Debug/Ex1" prefix_auto="1" extension_auto="1" />
11+
<Option object_output="obj/Debug/" />
12+
<Option type="1" />
13+
<Option compiler="gcc" />
14+
<Compiler>
15+
<Add option="-g" />
16+
</Compiler>
17+
</Target>
18+
<Target title="Release">
19+
<Option output="bin/Release/Ex1" prefix_auto="1" extension_auto="1" />
20+
<Option object_output="obj/Release/" />
21+
<Option type="1" />
22+
<Option compiler="gcc" />
23+
<Compiler>
24+
<Add option="-O2" />
25+
</Compiler>
26+
<Linker>
27+
<Add option="-s" />
28+
</Linker>
29+
</Target>
30+
</Build>
31+
<Compiler>
32+
<Add option="-Wall" />
33+
</Compiler>
34+
<Unit filename="main.c">
35+
<Option compilerVar="CC" />
36+
</Unit>
37+
<Extensions>
38+
<code_completion />
39+
<envvars />
40+
<debugger />
41+
</Extensions>
42+
</Project>
43+
</CodeBlocks_project_file>

LAB 10/Ex1/Ex1.depend

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# depslib dependency file v1.0
2+
1544821464 source:d:\new a\ders komp\italy\1 ci semester\programming 1\lab 10\ex1\main.c
3+
<stdio.h>
4+
<stdlib.h>
5+

LAB 10/Ex1/Ex1.layout

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
2+
<CodeBlocks_layout_file>
3+
<FileVersion major="1" minor="0" />
4+
<ActiveTarget name="Debug" />
5+
<File name="main.c" open="1" top="0" tabpos="1" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
6+
<Cursor>
7+
<Cursor1 position="263" topLine="0" />
8+
</Cursor>
9+
</File>
10+
</CodeBlocks_layout_file>

LAB 10/Ex1/bin/Debug/Ex1.exe

29 KB
Binary file not shown.

LAB 10/Ex1/main.c

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#include <stdio.h>
2+
#include <stdlib.h>
3+
4+
int main(int argc , char* argv[])
5+
{
6+
int a,b ;
7+
if (argc!=3) {
8+
puts("not enough arguments!") ;
9+
exit(1) ;
10+
}
11+
else {
12+
sscanf(argv[1], "%d",&a) ;
13+
sscanf(argv[2],"%d",&b) ;
14+
a=a+b ;
15+
printf("%d\n",a) ;
16+
17+
18+
19+
}
20+
21+
22+
23+
return 0;
24+
}

LAB 10/Ex1/obj/Debug/main.o

2.43 KB
Binary file not shown.

LAB 10/Ex2/Ex2.cbp

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
2+
<CodeBlocks_project_file>
3+
<FileVersion major="1" minor="6" />
4+
<Project>
5+
<Option title="Ex2" />
6+
<Option pch_mode="2" />
7+
<Option compiler="gcc" />
8+
<Build>
9+
<Target title="Debug">
10+
<Option output="bin/Debug/Ex2" prefix_auto="1" extension_auto="1" />
11+
<Option object_output="obj/Debug/" />
12+
<Option type="1" />
13+
<Option compiler="gcc" />
14+
<Compiler>
15+
<Add option="-g" />
16+
</Compiler>
17+
</Target>
18+
<Target title="Release">
19+
<Option output="bin/Release/Ex2" prefix_auto="1" extension_auto="1" />
20+
<Option object_output="obj/Release/" />
21+
<Option type="1" />
22+
<Option compiler="gcc" />
23+
<Compiler>
24+
<Add option="-O2" />
25+
</Compiler>
26+
<Linker>
27+
<Add option="-s" />
28+
</Linker>
29+
</Target>
30+
</Build>
31+
<Compiler>
32+
<Add option="-Wall" />
33+
</Compiler>
34+
<Unit filename="main.c">
35+
<Option compilerVar="CC" />
36+
</Unit>
37+
<Extensions>
38+
<code_completion />
39+
<envvars />
40+
<debugger />
41+
</Extensions>
42+
</Project>
43+
</CodeBlocks_project_file>

LAB 10/Ex2/Ex2.layout

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
2+
<CodeBlocks_layout_file>
3+
<FileVersion major="1" minor="0" />
4+
<ActiveTarget name="Debug" />
5+
<File name="main.c" open="1" top="0" tabpos="1" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
6+
<Cursor>
7+
<Cursor1 position="277" topLine="8" />
8+
</Cursor>
9+
</File>
10+
</CodeBlocks_layout_file>

LAB 10/Ex2/bin/Debug/Ex2.exe

28.8 KB
Binary file not shown.

LAB 10/Ex2/main.c

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
#include <stdio.h>
2+
#include <stdlib.h>
3+
4+
5+
int _CRT_glob = 0;
6+
7+
8+
int main( int argc , char* argv[])
9+
{
10+
int a,b ;
11+
char c ;
12+
if(argc!=4) {
13+
puts("Wrong input!") ;
14+
exit(1) ;
15+
}
16+
17+
18+
if (sscanf(argv[1], "%d",&a)!=1) {
19+
exit(1) ;
20+
}
21+
if (sscanf(argv[2],"%d",&b)!=1) {exit(1);}
22+
switch (argv[3][0]) {
23+
case '+' : {printf("%d\n",a+b) ;
24+
break ;
25+
}
26+
case '-' :{printf("%d\n",a-b) ;
27+
break ;
28+
}
29+
case '*' :{printf("%d\n",a*b) ; break;
30+
}
31+
case '/' :{if (b!=0)printf("%d",a/b) ;
32+
else exit(1) ;
33+
break ;
34+
}
35+
default: break ;
36+
37+
38+
}
39+
40+
41+
42+
43+
return 0;
44+
}

LAB 10/Ex2/obj/Debug/main.o

2.83 KB
Binary file not shown.

LAB 10/Ex3/Ex3.cbp

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
2+
<CodeBlocks_project_file>
3+
<FileVersion major="1" minor="6" />
4+
<Project>
5+
<Option title="Ex3" />
6+
<Option pch_mode="2" />
7+
<Option compiler="gcc" />
8+
<Build>
9+
<Target title="Debug">
10+
<Option output="bin/Debug/Ex3" prefix_auto="1" extension_auto="1" />
11+
<Option object_output="obj/Debug/" />
12+
<Option type="1" />
13+
<Option compiler="gcc" />
14+
<Compiler>
15+
<Add option="-g" />
16+
</Compiler>
17+
</Target>
18+
<Target title="Release">
19+
<Option output="bin/Release/Ex3" prefix_auto="1" extension_auto="1" />
20+
<Option object_output="obj/Release/" />
21+
<Option type="1" />
22+
<Option compiler="gcc" />
23+
<Compiler>
24+
<Add option="-O2" />
25+
</Compiler>
26+
<Linker>
27+
<Add option="-s" />
28+
</Linker>
29+
</Target>
30+
</Build>
31+
<Compiler>
32+
<Add option="-Wall" />
33+
</Compiler>
34+
<Unit filename="main.c">
35+
<Option compilerVar="CC" />
36+
</Unit>
37+
<Extensions>
38+
<code_completion />
39+
<envvars />
40+
<debugger />
41+
<lib_finder disable_auto="1" />
42+
</Extensions>
43+
</Project>
44+
</CodeBlocks_project_file>

LAB 10/Ex3/Ex3.layout

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
2+
<CodeBlocks_layout_file>
3+
<FileVersion major="1" minor="0" />
4+
<ActiveTarget name="Debug" />
5+
<File name="main.c" open="1" top="0" tabpos="2" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
6+
<Cursor>
7+
<Cursor1 position="268" topLine="0" />
8+
</Cursor>
9+
</File>
10+
</CodeBlocks_layout_file>

LAB 10/Ex3/bin/Debug/Ex3.exe

29.8 KB
Binary file not shown.

LAB 10/Ex3/main.c

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
#include <stdio.h>
2+
#include <stdlib.h>
3+
#include <math.h>
4+
int main(int argc , char* argv[])
5+
{
6+
7+
int x[5] ;
8+
int y[5], i=0,j=0 ;
9+
for (i=1 ; i<=4; i++) {
10+
scanf("%d %d", &x[i],&y[i]) ;
11+
}
12+
int Path=0 ;
13+
int length[3] ;
14+
for (i=1; i<4 ; i++) {
15+
length[i]=( int )sqrt((float)( (x[i]-x[i+1])*(x[i]-x[i+1])+(y[i]-y[i+1])*(y[i]-y[i+1])) );
16+
Path+=length[i] ;
17+
}
18+
19+
if (argv[1][1]=='m') {printf("%d\n",Path);}
20+
else {
21+
22+
int mini=Path ;
23+
int ini;
24+
for (i=1; i<=3 ; i++) {
25+
for (j=i+1 ; j<=4; j++) {
26+
ini=( int )sqrt((float)( (x[i]-x[j])*(x[i]-x[j])+(y[i]-y[j])*(y[i]-y[j])) );
27+
mini=(mini>ini ? ini : mini) ;
28+
}
29+
}
30+
31+
32+
printf("The minimum distance is : %d\n",mini) ;
33+
34+
}
35+
36+
37+
38+
39+
40+
return 0;
41+
}

LAB 10/Ex3/obj/Debug/main.o

3.14 KB
Binary file not shown.

LAB 10/Ex4/Ex4.cbp

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
2+
<CodeBlocks_project_file>
3+
<FileVersion major="1" minor="6" />
4+
<Project>
5+
<Option title="Ex4" />
6+
<Option pch_mode="2" />
7+
<Option compiler="gcc" />
8+
<Build>
9+
<Target title="Debug">
10+
<Option output="bin/Debug/Ex4" prefix_auto="1" extension_auto="1" />
11+
<Option object_output="obj/Debug/" />
12+
<Option type="1" />
13+
<Option compiler="gcc" />
14+
<Compiler>
15+
<Add option="-g" />
16+
</Compiler>
17+
</Target>
18+
<Target title="Release">
19+
<Option output="bin/Release/Ex4" prefix_auto="1" extension_auto="1" />
20+
<Option object_output="obj/Release/" />
21+
<Option type="1" />
22+
<Option compiler="gcc" />
23+
<Compiler>
24+
<Add option="-O2" />
25+
</Compiler>
26+
<Linker>
27+
<Add option="-s" />
28+
</Linker>
29+
</Target>
30+
</Build>
31+
<Compiler>
32+
<Add option="-Wall" />
33+
</Compiler>
34+
<Unit filename="main.c">
35+
<Option compilerVar="CC" />
36+
</Unit>
37+
<Extensions>
38+
<code_completion />
39+
<envvars />
40+
<debugger />
41+
<lib_finder disable_auto="1" />
42+
</Extensions>
43+
</Project>
44+
</CodeBlocks_project_file>

LAB 10/Ex4/Ex4.depend

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# depslib dependency file v1.0
2+
1544826238 source:d:\new a\ders komp\italy\1 ci semester\programming 1\lab 10\ex4\main.c
3+
<stdio.h>
4+
<stdlib.h>
5+
<string.h>
6+

LAB 10/Ex4/Ex4.layout

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
2+
<CodeBlocks_layout_file>
3+
<FileVersion major="1" minor="0" />
4+
<ActiveTarget name="Debug" />
5+
<File name="main.c" open="1" top="1" tabpos="1" split="0" active="1" splitpos="0" zoom_1="-1" zoom_2="0">
6+
<Cursor>
7+
<Cursor1 position="464" topLine="0" />
8+
</Cursor>
9+
</File>
10+
</CodeBlocks_layout_file>

LAB 10/Ex4/Last.txt

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
0 0 0 4 5
2+
1 2 0 4 5
3+
1 0 0 4 0
4+
1 2 3 4 5
5+
1 0 0 0 0

LAB 10/Ex4/bin/Debug/Ex4.exe

32.2 KB
Binary file not shown.

LAB 10/Ex4/input.dat

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
0 0 0 4 5
2+
1 2 0 4 5
3+
1 0 0 4 0
4+
1 2 3 4 5
5+
1 0 0 0 0

LAB 10/Ex4/input.data

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
0 0 0 4 5
2+
1 2 0 4 5
3+
1 0 0 4 0
4+
1 2 3 4 5
5+
1 0 0 0 0

LAB 10/Ex4/input.txt

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
0 0 0 4 5
2+
1 2 0 4 5
3+
1 0 0 4 0
4+
1 2 3 4 5
5+
1 0 0 0 0

0 commit comments

Comments
 (0)