-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path3_lotto.h
executable file
·46 lines (40 loc) · 874 Bytes
/
3_lotto.h
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
46
#ifndef INFORMATIK_3_LOTTO_H
#define INFORMATIK_3_LOTTO_H
// Lottery.cpp
#include <iostream>
#include <ctime>
const int SIZE = 6;
using namespace std;
//------------------- definition of functions -----------------------
bool check(int a[], int x) {
int i = 0;
while (a[i]) {
if (a[i] == x) { return true; }
i++;
}
return false;
}
void show(int a[], int n) {
for (int i = 0; i < n; i++) {
std::cout << a[i] << ", ";
}
std::cout << std::endl;
}
void initArray(int a[]) {
srand(time(NULL));
for (int i = 0; i < SIZE; i++) {
a[i] = rand() % 49 + 1;
}
}
int treffer(int a[], int tippschein[]) {
int counter = 0;
for(int i = 0; i < SIZE; i++)
{
for(int j = 0; j < SIZE; j++)
{
if(a[i] == tippschein[j]){counter++;}
}
}
return counter;
}
#endif