#include <iostream> int main() { int a, b, f1=0, f2=1, i; std::cout << "Введите число a: "; std::cin >> a; std::cout << "Введите число b: "; std::cin >> b; for(i = a; i <= b; i++) std::cout << i << " " ; std::cout << std::endl; if( a == 0 ) std::cout << 0 << " " ; while( f2 <= b ){ if( f2 >= a ) std::cout << f2 << " " ; i = f2; f2 = f1 + f2; f1 = i; } return 0; }
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter