Skip to content

Instantly share code, notes, and snippets.

@winhtut
Last active May 13, 2018 19:04
Show Gist options
  • Save winhtut/c009f5620eb78fdfe6888eb0f7ebf2c4 to your computer and use it in GitHub Desktop.
Save winhtut/c009f5620eb78fdfe6888eb0f7ebf2c4 to your computer and use it in GitHub Desktop.
Lottery Game<beginner>
#include<stdio.h>
#include<conio.h>
int money1(int x);
int main() {
int password, money;
int x;
printf_s("Welcome to our lottery game:\n Please enter your passcode:");
scanf_s("%d", &password);
if (password == 12345) {
printf_s("Plase enter your money:");
scanf_s("%d", &money);
if (money > 1000) {
printf_s("your money is %d\n", money);
while (password > 10) {
int number;
printf_s("please enter your lottery number:");
scanf_s("%d", &number);
if (number == 100 || number == 111 || number == 222)
{
printf_s("you are win in lottery:\n");
printf_s("This is your money %d", money1(money));
break;
}
else
{
printf_s("You are unlucky day !\n Try Again \n");
}
}
}
}
else
{
printf_s("You must be cop:");
}
_getch();
return 0;
}
int money1(int x) {
int payback = x * 100;
return payback;
}
#include<stdio.h>
#include<conio.h>
#include<stdlib.h>
int money_payback(int i);
void star(void);
int money = 0;
int main() {
int age = 0;
int pw = 12345;
int uid = 55565;
int game1 = 234;
int game2 = 567;
int game3 = 789;
int number = 0;
printf_s("Welcome to our lottery game! \n");
printf_s("Please enter your User ID \n");
scanf_s("%d", &uid);
printf_s("Please enter your Password \n");
scanf_s("%d", &pw);
if (pw == 12345 && uid == 55565) {
printf_s("Access Granted \n");
printf_s("You are welcome \n");
printf_s("Please enter your money:");
scanf_s("%d", &money);
if (money > 999) {
while (money > 999)
{
printf_s("Please enter your Lottey number:");
scanf_s("%d", &number);
if (number == game1 || number == game2 || number == game3)
{
system("@cls||clear");
printf_s("Congratulation ! \n you are win in lottery\n");
printf_s("Here is your money : %d \n", money_payback(money));
star();
break;
}
else
{
printf_s("Please try again\n");
}
}
}
else
{
printf_s("Your money must be more than 1000\n");
printf_s("Please try again\n");
system("pause");
}
}
else
{
printf_s("You must be Police\n");
printf_s("Good Bye xD");
}
_getch();
return 0;
}
int money_payback(int i) {
return i * 15;
}
void star(void) {
int y = 0;
int i = 0;
int ii = 0;
int iii = 0;
int z = 0;
int zz = 0;
int zzz = 0;
for (i = 0; i < 20; i++) {
int x = 20;
for (ii = 0; ii < x; ii++) {
printf_s(" ");
}
y = y + 1;
for (int o = 0; o < y; o++) {
printf_s("#");
}
int xx = 20;
for (zzz = 0; zzz <xx; zzz++) {
printf_s("_");
}
for (int xxx = 0; xxx < zzz; xxx++) {
printf_s("#");
}
printf_s("\n");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment