c
老猫 c.c
此人很懒
展开
-
我的大数相加
主要思想将数字以字符的形式存在数组中,两个数字相加时取两个字符数组中的每一个元素相加 ,并将相加的结果还以字符的形式保存在数组中。程序#include <stdio.h>#include <string.h>#define N 100/*********************** * 函 数 名:length() * 函数功能:计算字符串长...原创 2019-02-15 22:21:18 · 130 阅读 · 0 评论 -
不带头结点的单向链表 排序(递归)
#include <stdio.h>#include <stdlib.h>#include <time.h>struct node { int num; struct node * next;};typedef struct node Node;typedef struct node * Link;void creat_l...原创 2019-02-15 22:40:52 · 1082 阅读 · 2 评论 -
线程多参数传递
可以使用结构体.pthread_create函数的作用 创建一个线程,成功时返回0,错误时返回errno。thread:被创建线程的标识符,pthread_join使用这个标识符来等待该线程的结束。attr: 设置线程的属性,可以为NULL第三个参数是线程函数的入口地址arg:传递给线程的参数,当要传递给线程的参数有多个时,...原创 2019-05-08 21:09:57 · 633 阅读 · 0 评论 -
阶乘
#include <stdio.h>#define Max 2000000void factorial(int * a,int *p ,int num){ int c = *p , tmp = 0; for(int i = 0; i < c; i++) { a[i] = a[i] * num + tmp; tmp...原创 2019-08-16 13:16:56 · 114 阅读 · 0 评论