古典问题:有一对兔子,从出生后第3个月起每个月都生一对兔子,小兔子长到第三个月后每个月又生一对兔子,假如兔子都不死,问每个月的兔子总数为多少?解法一:(数组)public class rabbit { public static void main(String[] args) { ...
分类:
其他好文 时间:
2015-06-06 14:48:31
阅读次数:
121
#include
using namespace std;
struct Node //节点
{
int num[105];
int len; //数的长度
} a[105];
void CalCatalen() //卡特兰数计算
{
int i,j,len,c,t; //len长度,c进位
a[1].num[0]=a[1].len=1;
...
分类:
其他好文 时间:
2015-06-06 13:31:16
阅读次数:
138
**【冒泡排序的思想】**
冒泡排序总共进行n-1趟,每一趟扫描总是通过两两比较把大的往后放,所以第一趟即把最大数放在最后面,接着第二趟把第二大数放在倒数第二的位置………….到n-1完成,此时只有一个数未排序,这个数就是最小元素,不再需要扫描,此时完成对所有元素的排序。【冒泡排序的代码实现】#include
using namespace std;
void bubble(in...
分类:
编程语言 时间:
2015-06-06 12:11:53
阅读次数:
191
例题5——9 数据库 Database UVa 1592
#include
#include
#include
#include
using namespace std;
int cnt[10042][12];
int n,m;
void before()//此函数把每个格子里的字符串都映射成数字
{
int x=0;
char ch;
getchar(); // ...
分类:
其他好文 时间:
2015-06-06 12:07:09
阅读次数:
104
这里是rotate和splay函数void rotate(int x){ int y=pre[x],z=pre[y],d=ch[y][0]==x; ch[y][d^1]=ch[x][d];pre[ch[x][d]]=y; ch[z][ch[z][1]==y]=x;pre[x]=z;...
分类:
其他好文 时间:
2015-06-06 12:03:11
阅读次数:
112
1 //去掉集合中额重复元素 2 //方法:选择排序的思想 3 4 public class ArrayListDemo1 { 5 6 public static void main(String[] args) { 7 8 ArrayList arrayList =...
分类:
其他好文 时间:
2015-06-06 11:59:36
阅读次数:
99
void CEditControlDlg::OnClickedButton()
{ // TODO: Add your control notification handler code here //获得EDIT CEdit* pBoxOne; pBoxOne = (CEdit*) GetDlgI...
分类:
编程语言 时间:
2015-06-06 11:50:44
阅读次数:
807
实现效果大概就是这个样子的,图片不咋好看,凑活着看看 直接贴代码吧 首先创建一个singleview程序 将ViewController基类改成UITabBarController 然后写.m文件 如下[ps ?我这是开了arc的] -?(void)viewDidLo...
分类:
移动开发 时间:
2015-06-06 10:43:14
阅读次数:
351
import java.io.*;import java.net.*;public class TalkClient { public static void main(String args[]) { try { // 向本机的4700 端口发出客户请求 ...
分类:
其他好文 时间:
2015-06-06 10:30:39
阅读次数:
159
1:添加LocalAuthentication.framework框架2:实现过程#import "ViewController.h"#import @interface ViewController ()@end@implementation ViewController- (void)viewD...
分类:
移动开发 时间:
2015-06-06 10:29:50
阅读次数:
155