Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <time.h>
- int input;
- int checkduplicate(int array[]){
- return 0;
- }
- int lotterytype(int type){
- switch(type) {
- default:
- break;
- case 5:
- return 90;
- break;
- case 6:
- return 45;
- break;
- }
- return 0;
- }
- int generate(int lotto) {
- int i=1;
- int szamok[input];
- srand ( time(NULL) );
- szamok[0] = rand() % lotterytype(input) + 1;
- while (i<=input) {
- szamok[i] = rand() % lotterytype(input) + 1;
- printf("%d\n", szamok[i]);
- i++;
- }
- /*int z=0;
- while (z<=input-1) {
- printf("%d\n", szamok[z]);
- z++;
- }*/
- return 0;
- }
- int main() {
- printf("Milyen lottót szeretnél játszani?\n");
- scanf("%d", &input);
- while (input!=5 && input!=6) {
- printf("Csak 5-ös/6-os lottó választható!\n");
- scanf("%d", &input);
- }
- printf("\n");
- generate(lotterytype(input));
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement