![](https://img-blog.csdnimg.cn/20201014180756780.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
c,linux
远走低飞
一个新手闯天下
展开
-
数组的简单处理方式
#includevoid swap(int &a, int &b){ int p; p = a; a = b; b = p;}void init(int *arr){ int i; for (i = 0; i < 10; i++) { arr[i] = i + 1; }}void show(int *arr){ int i = 0; for (i = 0;原创 2015-05-06 12:04:17 · 317 阅读 · 0 评论 -
简单计算器(利用函数数组指针)带图片
#includedouble add(double a,double b){ return a+b;}double sub(double a,double b){ return a-b;}double mul(double a,double b){ return a*b;}double div(double a,double b){ return a/b;}in原创 2015-03-29 17:13:42 · 472 阅读 · 0 评论 -
double atof的实现(char型转double)
#includedouble my_atof(char*str){ int a= 1; double sum=0; double count =0; double bum; while(*str!='\0') { count=count*10; if(*str==' ') { count=count/10; } } else if(*str=='-')原创 2015-03-26 00:13:38 · 735 阅读 · 0 评论 -
字符数字转为整形数字
#includeint ascii_to_integar(char*str){ int sum = 0; int a= 1; while(*str!='\0') { if(*str==' ') { str++; } else if(*str=='-') { a=-1; str++; } else if(*str>='0'&& *str<=原创 2015-03-24 17:23:06 · 470 阅读 · 0 评论 -
c语言 输出乘法表
#include int main(){ fun(); return 0;}void fun(void){ int i; int j; for(i=1;i<=9;i++) { for(j=1;j<=i;j++) { printf("%d*%d=%d",i,j,i*j); if(i==j) { printf("\n");原创 2015-03-24 17:19:20 · 466 阅读 · 0 评论