摘要:
#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);} 阅读全文
摘要:
#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... 阅读全文
摘要:
#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 = ... 阅读全文
摘要:
#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... 阅读全文