Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
aostap
/
PR2KT1
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
9345ba1b
authored
May 31, 2023
by
aostap
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
main
parent
eea959b6
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
0 deletions
PR2main.c
PR2main.c
0 → 100644
View file @
9345ba1b
#include "PR2funktsioonid.c"
int
main
(
void
)
{
Ryhm
kirjed
[
100
];
int
kirjeteArv
=
0
;
FILE
*
f1
=
fopen
(
"F1.txt"
,
"r"
);
if
(
f1
==
NULL
)
{
printf
(
"Viga! Ei saa avada faili F1.txt
\n
"
);
return
1
;
}
// Loeme kirjed failist F1
loeKirjed
(
f1
,
kirjed
,
&
kirjeteArv
);
// Sorteerime kirjed vastavalt liigile
sorteeriKirjed
(
kirjed
,
kirjeteArv
);
FILE
*
f2
=
fopen
(
"F2.txt"
,
"w"
);
if
(
f2
==
NULL
)
{
printf
(
"Viga! Ei saa avada faili F2.txt
\n
"
);
return
2
;
}
// Väljastame kirjed faili F2
valjastaKirjed
(
f2
,
kirjed
,
kirjeteArv
);
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