mirror of
https://github.com/svek95/compiler-construction_UIBK-agecontrol.mc.git
synced 2026-05-17 18:41:48 +03:00
Add files via upload
add all file for task
This commit is contained in:
@@ -0,0 +1,30 @@
|
|||||||
|
bool ageforalco(int n)
|
||||||
|
{
|
||||||
|
if (n < 21) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
print("Enter you age: ");
|
||||||
|
|
||||||
|
int age;
|
||||||
|
age = read_int();
|
||||||
|
print_nl();
|
||||||
|
|
||||||
|
bool result;
|
||||||
|
result = ageforalco(age);
|
||||||
|
|
||||||
|
if (!result) {
|
||||||
|
print("You Can Drink!");
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
print("You Can't drink ):");
|
||||||
|
}
|
||||||
|
print_nl();
|
||||||
|
}
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
25
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
You Can Drink!
|
||||||
Reference in New Issue
Block a user