need help for easy lotto tool

Hi, i'm not familiar with c++ but would like to have a little command line tool to check my lotto numbers. i wrote a pseudo pseudo code and it would be nice if somebody could translate it into actual c++ code. It should work like that:

I have a .txt file with 6 numbers in every line, about 30 lines. i want the program compare every line for matches of the numbers i feed to the program via console. the numbers are seperated by space, like that: 8 23 5 44 12 27

the output should be like that:

3
fail
4
3
fail
5
...

here is my pseudo code:


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
$y as integer
$c as integer
$a as integer

$input as integerarray
$tip as integerarray


read $input from command line
$c = number of integer numbers in $input
open tipfile.txt

for every line in tipfile.txt
	read $tip from line
	$y = number of integer numbers in line
	
	while $y >= 0
		while $c >= 0
			if $input[$c] == $tip[$y] $a=$a+1;
			$c=$c-1;
		$y=$y-1;
		if $a > 2 print $a else print "fail";
		$a=0;

exit
Topic archived. No new replies allowed.