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,30 @@
void lucas_number (int x, int y, int num){
int z;
z=0;
while(num >= x)
{
print_int(x);
print(", ");
z=x+y;
x=y;
y=z;
}
}
int main()
{
int x;
int y;
int num;
print("Enter the limit of the Lucas number:");
print_nl();
x=2;
y=1;
num= read_int();
print("The Lucas numbers are: ");
lucas_number(x, y, num);
print_nl();
return 0;
}

View File

@@ -0,0 +1 @@
125

View File

@@ -0,0 +1,2 @@
Enter the limit of the Lucas number:
The Lucas numbers are: 2, 1, 3, 4, 7, 11, 18, 29, 47, 76, 123,