摘要: #include #include JO(int num[], int n){ int i = 0; int j = n - 1; while(i < j){ for(; i < j; i++){ if(isO(num[i])) break; } for(; i < j; j--){ if(!isO(num[j])) break; } if(i < j){ swap(num, i, j); i++;j--; ... 阅读全文
posted @ 2014-03-03 11:03 yutoulck 阅读(171) 评论(0) 推荐(0) 编辑
摘要: #include #include int ttj(int n){ int n1; int n2; if(n == 1) return 1; if(n == 2) return 2; n1 = ttj(n - 1); n2 = ttj(n - 2); return n2 + n1;}main(){ int num; num = ttj(3); printf("%d",num);} 阅读全文
posted @ 2014-03-03 10:53 yutoulck 阅读(107) 评论(0) 推荐(0) 编辑
摘要: #include #include swap(char* str, int b, int e){ char temp = str[b]; str[b] = str[e]; str[e] = temp;}print(char* str, int n){ int i; for(i = 0; i< n; i++){ printf("%c ", str[i]); } printf("\n");}int quanXuLie(char* str, int b, int n){ int i; if(n <= 1){ print... 阅读全文
posted @ 2014-03-03 10:39 yutoulck 阅读(154) 评论(0) 推荐(0) 编辑
摘要: #include #include typedef struct Node{ int content; struct Node* next;}LNode;init(LNode** head){ *head = (LNode*)malloc(sizeof(LNode)); (*head)->content = 0; (*head)->next = NULL;}insert(LNode* head, int num){ LNode* newNode = (LNode*)malloc(sizeof(LNode)); newNode -> content = ... 阅读全文
posted @ 2014-03-03 09:27 yutoulck 阅读(256) 评论(0) 推荐(0) 编辑
摘要: #include find(char* str, int n){ int i = 1; char temp = str[0]; int num = 1; while(i < n){ if(str[i] == temp){ num++; } else if(num == 0){ temp = str[i]; num = 0; } else{ num--; } i++; } pr... 阅读全文
posted @ 2014-03-03 09:01 yutoulck 阅读(121) 评论(0) 推荐(0) 编辑