Add student example inputs
This commit is contained in:
28
examples/agecontrol/agecontrol.mc
Normal file
28
examples/agecontrol/agecontrol.mc
Normal file
@@ -0,0 +1,28 @@
|
||||
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't drink ):");
|
||||
}
|
||||
else {
|
||||
print("You Can Drink!");
|
||||
}
|
||||
print_nl();
|
||||
}
|
1
examples/agecontrol/agecontrol.stdin.txt
Normal file
1
examples/agecontrol/agecontrol.stdin.txt
Normal file
@@ -0,0 +1 @@
|
||||
25
|
2
examples/agecontrol/agecontrol.stdout.txt
Normal file
2
examples/agecontrol/agecontrol.stdout.txt
Normal file
@@ -0,0 +1,2 @@
|
||||
Enter you age:
|
||||
You Can Drink!
|
Reference in New Issue
Block a user