• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
WuhaYaoShenmeAi
博客园 首页 新随笔 联系 订阅 订阅 管理
上一页 1 2

2013年6月8日

日期之差
摘要: #include #include using namespace std; int days[][2]={ 0,0, 31,31, 28,29, 31,31, 30,30, 31,31, 30,30, 31,31, 31,31, 30,30, 31,31, 30,30, 31,31 }; int isRun(int year){ if(year%4 ==0 && year%100!=0 || year%400 ==0) return 1; else return 0; } struct Date{ int year; int month... 阅读全文
posted @ 2013-06-08 17:29 WuhaYaoShenmeAi 阅读(83) 评论(0) 推荐(0)
 
字符串库函数
摘要: #include using namespace std; int strlenn(const char* str) { int i=0; while (str[i]!=0) i++; return i; } int strcmp(const char* s1,const char* s2) { int len1=strlenn(s1); int len2=strlenn(s2); for (int i=0;is2[i]) return 1; } if(len1 len2) return 1; return 0; } int strcopy(char* s1,con... 阅读全文
posted @ 2013-06-08 17:25 WuhaYaoShenmeAi 阅读(100) 评论(0) 推荐(0)
 
排序算法
摘要: 简单选择排序 #include using namespace std; void swap(int &a,int &b) { int temp = a; a=b ; b=temp; } void choiceSort(int A[],int n) { for(int i=0;iA[j+1]){ int temp = A[j]; A[j]=A[j+1]; A[j+1]=temp; } } } } public static void dbubble_sort(int[] A){ for(int i=0;iA[j+1]){ ... 阅读全文
posted @ 2013-06-08 17:24 WuhaYaoShenmeAi 阅读(102) 评论(0) 推荐(0)
 
数据结构实现
摘要: 链表实现#include #include using namespace std; struct LNode{ int data; LNode* next; }; typedef LNode* LinkedList; void creatLinkList(LinkedList &L){ L= (LinkedList)malloc(sizeof(LNode)); L->data=0; L->next=NULL; int x; cout>x; for (int i=0;i>tmp; LinkedList t = (LinkedList)malloc(sizeof( 阅读全文
posted @ 2013-06-08 17:16 WuhaYaoShenmeAi 阅读(127) 评论(0) 推荐(0)
 
 

2013年4月24日

【数据结构C实现】1.顺序表实现
摘要: #include #include #define INIT_SIZE 100 #define LIST_INCRE 10 struct SqList{ int* pElem; int length; int listsize; }; typedef struct SqList SqList; SqList L; int init_SqList(SqList &L){ L.pElem=(int*)malloc(INIT_SIZE*sizeof(int)); L.length=0; L.listsize=INIT_SIZE; return 0; } int destroy_Sq... 阅读全文
posted @ 2013-04-24 21:45 WuhaYaoShenmeAi 阅读(155) 评论(0) 推荐(0)
 
 
上一页 1 2

公告


博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3