Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
rakein
/
iag0582
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
f1696577
authored
Feb 22, 2017
by
rakein
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Upload new file
parent
a8893230
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
82 additions
and
0 deletions
3nurkad/kolmnurgaasi.c
3nurkad/kolmnurgaasi.c
0 → 100644
View file @
f1696577
#include <stdio.h>
#include "pindalaArvutaja.h"
#include "seeStruct.h"
#include "checkFile.h"
#include "v2ljastus.h"
#include "check3Nurk.h"
//#include "externalVariable.h"
extern
int
MAX
=
10
;
int
sisse
(
seeStruct
X
[],
int
);
int
main
(
void
)
{
seeStruct
A
[
MAX
];
seeStruct
B
[
MAX
];
seeStruct
C
[
MAX
];
FILE
*
S
;
int
i
=
0
;
double
pindalas
[
MAX
];
int
check
=
0
;
check
+=
sisse
(
A
,
1
);
check
+=
sisse
(
B
,
2
);
check
+=
sisse
(
C
,
3
);
if
(
check
!=
0
)
{
return
0
;
}
for
(
i
=
0
;
i
<
10
;
i
++
)
{
check
=
check3Nurk
(
A
,
B
,
C
,
i
);
if
(
check
==
0
)
{
pindalas
[
i
]
=
pindala
(
A
,
B
,
C
,
i
);
}
else
{
pindalas
[
i
]
=
0
;
}
}
v2ljastus
(
S
,
pindalas
);
return
0
;
}
int
sisse
(
seeStruct
X
[
MAX
],
int
param
)
{
FILE
*
andmed
;
int
check
=
0
;
int
i
=
0
;
if
(
param
==
1
)
{
andmed
=
fopen
(
"aAndmed.txt"
,
"r"
);
check
+=
checkFile
(
andmed
);
}
else
if
(
param
==
2
)
{
andmed
=
fopen
(
"bAndmed.txt"
,
"r"
);
check
+=
checkFile
(
andmed
);
}
else
{
andmed
=
fopen
(
"cAndmed.txt"
,
"r"
);
check
+=
checkFile
(
andmed
);
}
if
(
check
==
0
)
{
printf
(
"seda faili pole "
);
return
1
;
}
while
(
i
<
MAX
)
{
fscanf
(
andmed
,
"%lf %lf"
,
&
X
[
i
].
x
,
&
X
[
i
].
y
);
i
++
;
}
fclose
(
andmed
);
return
0
;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment