#C13711. Fibonacci Sequence Generator
Fibonacci Sequence Generator
Fibonacci Sequence Generator
This problem requires you to generate the first n terms of the Fibonacci sequence. The Fibonacci sequence is defined by the recurrence relation \(F_n = F_{n-1} + F_{n-2}\) for \(n \ge 2\), with initial terms \(F_0 = 0\) and \(F_1 = 1\). If the input is invalid (i.e. not a positive integer), your program should output the error message: "Error: Input must be a positive integer."
Your solution should read input from standard input and produce output to standard output.
inputFormat
The input consists of a single line containing one positive integer (n). Note that (n) must be a positive integer.
outputFormat
If the input is valid, output the first (n) terms of the Fibonacci sequence separated by a single space. Otherwise, output the error message exactly as: "Error: Input must be a positive integer."## sample
1
0