Add example inputs

This commit is contained in:
Alex Hirsch
2019-01-06 12:11:47 +01:00
parent 0045501c5e
commit bd7fae8198
36 changed files with 624 additions and 0 deletions

View File

@@ -0,0 +1,36 @@
bool isLeapYear(int n)
{
if ((modulo(n,4) == 0 && modulo(n,100) != 0) || (modulo(n,400) == 0)){
return true;
}
return false;
}
int modulo(int k, int i)
{
while (k > 0){
k = k - i;
}
return k;
}
int main()
{
print("Please enter a year: ");
print_nl();
int n;
n = read_int();
print_int(n);
if (isLeapYear(n)){
print(" is a leap year.");
}
else
{
print(" is not a leap year.");
}
print_nl();
return 0;
}

View File

@@ -0,0 +1 @@
2020

View File

@@ -0,0 +1,2 @@
Please enter a year:
2020 is a leap year.