void * Mymemcpy(void * dest ,const void *src ,size_t count) { void *temp = dest; if (dest< src) { while (count--) { *(char *)dest = *(char *)src; ++(c ...
转载 2021-04-13 07:40:00
82阅读
2评论
看了原理和比人的代码后,终于自己写了一个EM的实现。我从网上找了一些身高性别的数据,用EM算法通过身高信息来识别性别。实现的效果还行,正确率有84% (初始数据 男生170 女生160 方差都是10) 79% (初始数据 男生165 女生150 方差都是10)正确率与初...
转载 2014-09-19 15:30:00
231阅读
2评论
#define _CRT_SECURE_NO_WARNINGS#include<stdio.h>void bubble_sort(int arr[], int sz){ int i = 0; for (i = 0; i < sz - 1; i++) { int j = 0; for (j = 0; j < sz - 1 - i; j++) {
原创 2023-03-17 23:09:57
131阅读
void * Mymemcpy(void * dest ,const void *src ,size_t count) { void *temp = dest; while (count--) { *(char *)dest = *(char *)src; ++(char *)src; ++(cha ...
转载 2021-04-13 07:09:00
150阅读
2评论
char * Mystrtok(char * string, const char * control) { unsigned char *str; const unsigned char *ctrl = (const unsigned char *)control; //注意这里使用了static ...
转载 2021-04-13 08:04:00
142阅读
2评论
<br />/*链队列的实现*/<br />#include <iostream><br />using namespace std;<br /><br />/*链队列类型定义*/<br />typedef struct QNode<br /next;<br /> char
原创 2023-08-27 11:26:49
95阅读
C++投票规则如下: 1. 每个投票者只可以投一次票. 投票者通过生成的随机数在第一个到最后一个候选人之间选择一个候选人来进行投票。 2. 每一个候选人都保存着投票者给他们投票的记录。 3. 选举之后, 拥有最高投票数的候选人当选。 ---------------------------Person类的Person.h-------
原创 2015-08-12 14:27:25
5027阅读
2点赞
1评论
欧几里得距离 欧几里得距离定义: 欧几里得距离( Euclidean distance)也称欧式距离,它是一个通常采用的距离定义,它是在m维空间中两个点之间的真实距离。 在二维和三维空间中的欧式距离的就是两点之间的距离,二维的公式是 d = sqrt((x1-x2)^+(y1-y2)^) 三维的公式是 d=sqrt((x1-x2)^+(y1-y2)^+(z1-z2)^) 推广到n维空间,欧式距离的公式是 d=sqrt( ∑(xi1-xi2)^ ) 这里i=1,2..n xi1表示第一个点的第i维坐标,xi2表示第二个点的第i维坐标 n维欧氏空间是一个点集,它的每个点可以表示...
原创 2021-09-04 10:35:12
3977阅读
插入排序: 就像摸牌,摸一张插进去,找一个哨兵。从第二个開始,和前一个比較。小的话前移一位。 #include <iostream> #include<stdlib.h> using namespace std; #define N 4 //不能加分号结束 class sort { public: void insertSort(int a[],in
转载 2017-08-01 11:24:00
122阅读
2评论
#include <iostream> using namespace std; #define MAX 10000000 #define MAX_VERTEX_NUM 20 /*顺序栈的定义*/ #define Stack_
原创 2023-08-27 11:19:01
271阅读
<br />#include <iostream>using namespace std;#define MAX 10000000#define MAX_VERTEX_NUM 20int ve[MAX_VERTEX
原创 2023-08-27 11:16:41
161阅读
<br /><br />/************************线索链表的实现*************************/<br />#include <iostream><br />using namespace std;<br /><
原创 2023-08-27 11:19:32
102阅读
#include<stdio.h>#include<math.h>#include<windows.h>#include<time.h>#incl
原创 2022-05-14 16:53:20
10000+阅读
2点赞
c++写和平精英
原创 2022-10-11 18:11:38
9780阅读
C语言实现cgi webshell#include <stdio.h> #include <stdio.h> #include <string.h> #include <unistd.h> #include <stdlib.h> #include <sys/types.h&
原创 精选 2015-02-05 14:51:31
4345阅读
C语言实现cgi webshell#include <stdio.h>#include <stdio.h>#include <string.h>#include <unistd.h>#include <stdlib.h>#include <sys/types.h>#i
转载 精选 2015-03-26 10:30:53
559阅读
自己学习《APUE》时写的linux下一些命令(大概40个左右)实现,仅当学习使用,这些命令包含cat cp echo head ls paste rmdir tail umask who chattr cut expand join mkdir pwd sed tee uniq chgrp dat
转载 2016-02-26 18:01:00
290阅读
2评论
先贴问题:Delete Operation for Two StringsGiven two words word1 and word2, find the minimum number of steps required to make word1 and word2 the same, where in each step you can delete one character in eit
鱼弦:公众号:红尘灯塔,CSDN内容合伙人、CSDN新星导师、51CTO(Top红人+专家博主) 、github开源爱好者(go-zero源码二次开发、游戏后端架构 https://github.com/Peakchen)为了实现购买功能,你可以添加一个变量来记录购买的商品数量,然后在循环中根据用户输入的商品名和数量计算出购买总价。以下是修改后的代码:#include <stdio
原创 2024-03-07 10:14:21
98阅读
C中如何调用C++函数的问题,简单回答是将函数用extern "C"声明,当被问及如何将类内成员函数声明时,一时语塞,后来网上查了下,网上有一翻译C++之父的文章可以作为解答,遂拿来Mark一下。将C++函数声明为``extern "C"''(在你的C++代码里做这个声明),然后调用它(在你的C或者C++代码里调用)。例如:// C++ code:extern "C" void f(int);v
  • 1
  • 2
  • 3
  • 4
  • 5