摘要:
// Fibonaqii.cpp : Defines the entry point for the console application./*data:2013/10/05auth:ljzfunc:斐波那契数列的非递归实现*/#include "stdafx.h"#include "iostream"using namespace std;int Fibonaqii(int n){ int a=1,b=1,c; if (n == 1 || n ==2) { return 1; } else { for (int i =3;i>n; cout&l 阅读全文
posted @ 2013-10-05 21:03
呱呱老师
阅读(138)
评论(0)
推荐(0)
摘要:
// Fibonaqi.cpp : Defines the entry point for the console application./*data:2013/10/05auth:ljzfunc:斐波那契Fn的递归函数*/#include "stdafx.h"#include "iostream"using namespace std;int Fibonaqi(int n){ if (n == 1 || n == 2) { return 1; } else { return ( Fibonaqi(n-1)+Fibonaqi(n-2) ); }}int 阅读全文
posted @ 2013-10-05 20:39
呱呱老师
阅读(196)
评论(0)
推荐(0)
摘要:
// Factorial.cpp : Defines the entry point for the console application./*data:2013/10/05auth:ljzfunc:n!的递归实现*/#include "stdafx.h"#include "iostream"using namespace std;int Factorial(int n){ if (n==1) { return 1; } else { return n*Factorial(n-1); }}int main(int argc, char* argv[]) 阅读全文
posted @ 2013-10-05 20:35
呱呱老师
阅读(128)
评论(0)
推荐(0)
摘要:
// Factorial.cpp : Defines the entry point for the console application./*data:2013/10/05auth:ljzfunc:n!的非递归实现*/#include "stdafx.h"#include "iostream"using namespace std;int Factorial(int n){ int sum =1; for (int i=1;i>a; cout<<Factorial(a)<<endl; return 0;} 阅读全文
posted @ 2013-10-05 20:31
呱呱老师
阅读(128)
评论(0)
推荐(0)
摘要:
// rise.cpp : Defines the entry point for the console application./*data:2012/10/05auth:ljzfunc:rise判断数组是不是按升序排列的。*/#include "stdafx.h"#include "iostream"using namespace std;bool rise(int b[]){ for (int i =0;i=b[i+1]) { return false; } } return true;}int main(int argc, char* argv 阅读全文
posted @ 2013-10-05 20:27
呱呱老师
阅读(147)
评论(0)
推荐(0)
摘要:
// Input.cpp :/*data:2013/10/5auth:liaojiangzhengfunc: INPUT(&a)用户输入一个非负的数,并且负责验证输入的是不是正数,如果不是告诉用户输入非法,重输(共3次机会)。输入成功,将输入的数作为引用参数返回。函数成功返回true,否则返回false。*/#include "stdafx.h"#include "iostream"using namespace std;bool INPUT( float &a){ int i = 0; float b; b=a; while (b> 阅读全文
posted @ 2013-10-05 20:05
呱呱老师
阅读(182)
评论(0)
推荐(0)

浙公网安备 33010602011771号