-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgenhakuMain.c
45 lines (32 loc) · 961 Bytes
/
genhakuMain.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#include <stdio.h>
#include "genhaku.h"
/*
03 - Geneerinen haku.
"Aseta vastauksesi tiedostoihin genhaku.c ja genhaku.h."
T�m�n testikoodin suorituksen pit�isi tulostaa:
2 10
2 10
*/
int main(void) {
int ix[10] = {4, 1, 0, 8, 2, 9, 0, 8, 2, 9};
int iy[4] = {0, 8, 2, 9};
int iz[4] = {0, 9, 2, 8};
short sx[10] = {4, 1, 0, 8, 2, 9, 0, 8, 2, 9};
short sy[4] = {0, 8, 2, 9};
short sz[4] = {0, 9, 2, 9};
/* WETO:n testi */
const int s = 12;
double mista[s] = {0.4, 0.9, 1.2, 0.6, 0.3, 0.8, 0.5, 0.9, 0.1, 1.1, 0.3, 0.8};
double milla[2] = {0.1, 0.2};
typedef unsigned long ulong;
printf("%lu %lu\n",
(ulong) etsi(ix, 10, iy, 4, sizeof(int)),
(ulong) etsi(ix, 10, iz, 4, sizeof(int)));
printf("%lu %lu\n",
(ulong) etsi(sx, 10, sy, 4, sizeof(short)),
(ulong) etsi(sx, 10, sz, 4, sizeof(short)));
printf("%lu\n",
(ulong) etsi(mista, s, milla, 2, sizeof(double))
);
return 0;
}