C++写的斐波那切数列
#include <iostream> #include <fstream> #include <cstdlib> /*斐波那切数列*/ int main() { int count = 10; int x = 0; int y = 1; int sum = 0; if (x == 0) { printf("%d\t", x); } if (y == 1) { printf("%d\t", y); } for (int i = 1; i <= 10; i++) { sum = x + y; printf("%d\t", sum); x = y; y = sum; } return 0;
标签:数列,int,那切,斐波,printf,include From: https://www.cnblogs.com/yoyoma0355/p/17213718.html