1
0
Fork 0
You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

35 lines
759 B
C++

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

//#include <stdio.h>
#include <iostream>
using namespace std;
#include <stdlib.h>
#include "K_Fib.h"
#include "Recursive.h"
#include "SeqQueue.h"
void main()
{
/*第一个测试任务递归问题的求解测试输出一个正整数n*/
int n;
cout << "请输入一个正整数:"; //注意输入的正整数值不能超过整数类型可以正确表达的范围
cin >> n;
cout << "递归输出该正整数:";
PrintOut(n);
cout << endl;
/*第二个测试任务队列的应用测试K阶斐波那契序列计算器*/
int K;
int max;
cout << "求K阶斐波那契序列" << endl;
cout << "请输入K值";
cin >> K;
cout << "请输入max值";
cin >> max;
cout << "最大项小于或等于" << max << "" << K << "阶斐波那契序列:";
K_Fib(K, max);
cout << endl;
system("pause");
}