Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
kmicha
/
Proge_2_KT1
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
1b4115db
authored
Feb 27, 2024
by
kmicha
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Upload New File
parent
6a76684b
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
46 additions
and
0 deletions
Mitme faili versioon/index.c
Mitme faili versioon/index.c
0 → 100644
View file @
1b4115db
#include "head.h"
int
main
(
void
){
FILE
*
F1
,
*
F2
;
char
F1nimi
[
20
],
F2nimi
[
20
];
int
k
,
n
,
R
,
Xo
,
Yo
;
failiNimi
(
F1nimi
,
"Koordinaatide faili nimi:
\n
"
);
F1
=
fopen
(
F1nimi
,
"r"
);
// Kontroll, kas fail eksisteerib/avati õigesti
k
=
kontroll
(
F1
);
if
(
k
==
1
){
printf
(
"Faili ei leitud!"
);
return
1
;
}
failiNimi
(
F2nimi
,
"Väljastus faili nimi:
\n
"
);
F2
=
fopen
(
F2nimi
,
"w"
);
n
=
failiPikkus
(
F1
);
//leiame mitu kirjet on failis et moodustada array
printf
(
"faili pikkus: %d
\n
"
,
n
);
koordinaadid
punktid
[
n
];
//failis olevad koordinaadid
ring
raadius
[
n
];
// Ringi raadiusesse jäävad puntkid
taitmine
(
F1
,
n
,
punktid
);
// faili info programmi mällu
fclose
(
F1
);
// pole enam vaja
sisestus
(
&
R
,
&
Xo
,
&
Yo
,
"Sisesta ringi raadius R:
\n
"
,
"Sisesta ringi keskpunkti X koordinaat:
\n
"
,
"Sisesta ringi keskpunkti Y koordinaat:
\n
"
);
printf
(
"Arvud sisestatud
\n
"
);
// leiame raadiusesse jäävad punktid ja väljastame
arvutus
(
R
,
Xo
,
Yo
,
n
,
punktid
,
raadius
);
valjastus
(
F2
,
n
,
raadius
);
fclose
(
F2
);
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