Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Jürgen Hein
/
iax0583
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
a7faa468
authored
Oct 10, 2024
by
Jürgen Hein
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Upload New File
parent
793d3a0e
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
83 additions
and
0 deletions
Tunnitöö 10.10.24/MassiivSortFunktsioonid.c
Tunnitöö 10.10.24/MassiivSortFunktsioonid.c
0 → 100644
View file @
a7faa468
/*Kasutaja sisestab 2 massiivi klaviatuurilt K1[n1], K2[n2]
/*Kasutaja sisestab 2 massiivi klaviatuurilt K1[n1], K2[n2]
* Massiivide elemendid liidetakse, moodustatakse
* uus massiiv K[n].
* salvestatakse uuele id massiivile
* Väljastatakse minimaalsete elementide massiiv,
* minimaalselt 3 alamprogrammi. */
#include <stdio.h>
//Prototüübid
int
sisestus
(
char
[]);
void
maatriksSisse
(
int
,
int
,
int
[],
int
[]);
void
v
ä
ljastusM
(
int
,
int
,
int
[]);
void
YhineMassiiv
(
int
,
int
,
int
,
int
[],
int
[],
int
[]);
void
Sortimine
(
int
,
int
[],
int
[]);
void
V
ä
ljastus
(
int
,
char
[]);
int
main
(
void
)
{
int
n1
,
n2
,
m
,
n
,
i
;
int
maatriksk1
[];
int
maatriksk2
[];
int
K
[];
m
=
sisestus
(
"Sisesta ruutmaatriksi mõõde:"
);
maatriksSisse
(
n1
,
n2
,
maatriksk1
[],
maatriksk2
[]);
v
ä
ljastusMM
(
n1
,
n2
,
maatriksk1
[],
maatriksk2
[]);
YhineMassiiv
(
n
,
n1
,
n2
,
maatriksk1
[],
maatriksk2
[],
K
[
i
]);
Sortimine
(
n
,
K
[
i
],
K
[
i
+
1
],);
V
ä
ljastus
(
m
,
K
[
i
]);
return
0
;
}
/*
int sisestus(char teade[]){
int m;
printf("%s", teade);
scanf("%d", &m);
return m;
void maatriksSisse(int n1, int n2, int k1[n1], int k2[n2]) //Maatriksite sisselugemine
{
int i;
for(i=0;i<n1;i++){
printf("Sisesta 1. massiivi element nr %d:", i);
scanf("%d\n", &k1[i]);
}
for(i=0;i<n1;i++){
printf("Sisesta 2. massiivi element nr %d:", i);
scanf("%d\n", &k2[i]);
}
}
/*
void YhineMassiiv(int n1, int n2, int k1[n1], int k2[n2], int K[i])
{
int n,i,j;
for(i=0;i<n1;i++) //K[n] moodustamine
{
n=n1+n2;
K[n]=n;
}
i=0;
for(j=0;j<n;j++)
{
K[j]=K2[i-n1];
}
}
/*
void Sortimine(n,maatriks[n])
{
}
void väljastusM(int n1, int n2, int K2[n2], int K1[n1])
{
printf("%s", );
int i;
for (i = 0; i < m; i++)
{
printf("%d ", K[i]);
}
printf("\n");
}
*/
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