06 2023 档案

学习使用如何调用外部函数
摘要:>学习使用如何调用外部函数 ```c #include int a,b,c; void add() { int a; a=3; c=a+b; } int main() { a=b=4; add(); printf("c的值为%d\n",c); return 0; } 阅读全文

posted @ 2023-06-11 20:49 wessf 阅读(23) 评论(0) 推荐(0) 编辑

学习使用static的另一用法
摘要:>学习使用static的另一用法 ```c #include int main() { int i,num; num=2; for(i=0;i<3;i++) { printf("num变量为%d\n",num); num++; { static int num=1; printf("内置模板num变 阅读全文

posted @ 2023-06-11 20:49 wessf 阅读(5) 评论(0) 推荐(0) 编辑

学习 static 定义静态变量的用法
摘要:>学习 static 定义静态变量的用法 ```c #include void foo() { static int x=0; x++; printf("%d\n",x); } int main() { foo(); foo(); foo(); return 0; } 阅读全文

posted @ 2023-06-11 20:49 wessf 阅读(13) 评论(0) 推荐(0) 编辑

学习使用auto定义变量的用法
摘要:>学习使用auto定义变量的用法 ```c #include int main() { int i,num; num=2; for(i=0;i<3;i++) { printf("num变量为%d\n",num); num++; { auto int num=1; printf("内置模板num变量: 阅读全文

posted @ 2023-06-11 20:49 wessf 阅读(18) 评论(0) 推荐(0) 编辑

复数相加
摘要:>复数相加 ```c #include typedef struct complex { float real; float imag; } complex; complex add(complex n1,complex n2); int main() { complex n1, n2, temp; 阅读全文

posted @ 2023-06-10 20:40 wessf 阅读(18) 评论(0) 推荐(0) 编辑

将字符串写入文件
摘要:>将字符串写入文件 ```c #include #include int main() { char sentence[1000]; FILE *fptr; fptr=fopen("runoob.txt","w"); if(fptr==NULL) { printf("error"); exit(1) 阅读全文

posted @ 2023-06-10 20:40 wessf 阅读(20) 评论(0) 推荐(0) 编辑

计算标准偏差
摘要:>计算标准偏差 ```c #include #include float calculateSD(float data[]); int main() { int i; float data[10]; printf("输入十个元素: "); for(i=0;i<10;++i) { scanf("%f" 阅读全文

posted @ 2023-06-09 21:30 wessf 阅读(18) 评论(0) 推荐(0) 编辑

值传递与地址传递的区别
摘要:>值传递与地址传递的区别 ```c #include int ArrayCopy(char* ori, char* cop, char Length) { char loop; for(loop = 0; loop 拷贝后的数组 \n"); for(loop = 0; loop 拷贝后的数组 \n" 阅读全文

posted @ 2023-06-09 21:29 wessf 阅读(21) 评论(0) 推荐(0) 编辑

将一个数组拆分为一个为奇数数组,一个为偶数数组
摘要:>将一个数组拆分为一个为奇数数组,一个为偶数数组 ```c #include int main() { int a[10]={0,1,2,3,4,5,6,7,8,9}; int i[10],j[10]; int b,c,d; c=d=0; for(b=0;b<10;b++) { if(a[b]%2= 阅读全文

posted @ 2023-06-08 20:40 wessf 阅读(51) 评论(0) 推荐(0) 编辑

将奇数数组与偶数数组合并为一个数组
摘要:>将奇数数组与偶数数组合并为一个数组 ```c #include int main() { int a[10]; int i[10]={0,2,4,6,8}; int j[10]={1,3,5,7,9}; int b,c,d,e; d=e=5; c=0; for(b=0;b<d;b++) { a[c 阅读全文

posted @ 2023-06-08 20:40 wessf 阅读(34) 评论(0) 推荐(0) 编辑

八进制转换为二进制
摘要:>八进制转换为二进制 ```c #include #include long long convertOctalToBinary(int octalNumber); int main() { int octalNumber; printf("输入一个八进制数: "); scanf("%d", &oc 阅读全文

posted @ 2023-06-07 20:50 wessf 阅读(314) 评论(0) 推荐(0) 编辑

二进制转换为八进制
摘要:>二进制转换为八进制 ```c #include #include int convertBinarytoOctal(long long binaryNumber); int main() { long long binaryNumber; printf("输入一个二进制数: "); scanf(" 阅读全文

posted @ 2023-06-07 20:49 wessf 阅读(173) 评论(0) 推荐(0) 编辑

八进制转换为十进制
摘要:>八进制转换为十进制 ```c #include #include long long convertOctalToDecimal(int n); int main() { int n; printf("输入一个八进制数: "); scanf("%d", &n); printf("八进制数 %d 转 阅读全文

posted @ 2023-06-06 20:45 wessf 阅读(397) 评论(0) 推荐(0) 编辑

十进制转换为八进制
摘要:>十进制转换为八进制 ```c #include #include int convertDecimalToOctal(int n); int main() { int n; printf("输入一个十进制数: "); scanf("%d", &n); printf("十进制数 %d 转换为八进制位 阅读全文

posted @ 2023-06-06 20:45 wessf 阅读(597) 评论(0) 推荐(0) 编辑

二进制转换为十进制
摘要:>二进制转换为十进制 ```c #include #include int convertBinaryToDecimal(long long n); int main() { long long n; printf("输入一个二进制数:"); scanf("%lld",&n); printf("二进 阅读全文

posted @ 2023-06-05 20:24 wessf 阅读(38) 评论(0) 推荐(0) 编辑

十进制转换为二进制
摘要:>十进制转换为二进制 ```c #include #include long long convertDecimalToBinary(int n); int main() { int n; printf("输入一个十进制数: "); scanf("%d", &n); printf("十进制数 %d 阅读全文

posted @ 2023-06-05 20:24 wessf 阅读(76) 评论(0) 推荐(0) 编辑

将将16进制的字符串,两个两个转化为16进制的数值
摘要:>将将16进制的字符串,两个两个转化为16进制的数值 ```c #include #include int sthvalue(char c) { int value; if((c>='0')&&(c='a')&&(c='A')&&(c<='F')) { value=55; } else { prin 阅读全文

posted @ 2023-06-04 20:52 wessf 阅读(14) 评论(0) 推荐(0) 编辑

将10进制数转换为16进制的字符
摘要:>将十进制数转换为十六进制数,dec2hexa:将十进制数转换为十六进制数 ```c #include void dec2hexa(int n) { int i=0,d=n; int m=0,t=0; char hexa[64]; char *hmap="0123456789ABCDEF"; whi 阅读全文

posted @ 2023-06-03 20:50 wessf 阅读(38) 评论(0) 推荐(0) 编辑

十进制转十六进制
摘要:>十进制转十六进制 ```c #include int main() { char a[32]="0123456789ABCDEF"; char b[100]; int n; int c=0; scanf("%d",&n); if(n==0) { printf("0\n"); } while(n) 阅读全文

posted @ 2023-06-03 20:50 wessf 阅读(102) 评论(0) 推荐(0) 编辑

十六进制转10进制
摘要:>十六进制转10进制 ```c #include int main() { char a[100]={0}; int i=0,j=0; printf("输入一个数:"); fgets(a,100,stdin); while(a[i]) { if(a[i]>='0'&&a[i]='a'&&a[i]=' 阅读全文

posted @ 2023-06-02 20:35 wessf 阅读(105) 评论(0) 推荐(0) 编辑

二分查找
摘要:>二分查找 ```c #include int binary_search(int *a,int p,int q,int ele) { int mid=0; if(p>q) { return 0; } mid=p+(q-p)/2; if(ele==a[mid]) { return mid; } if 阅读全文

posted @ 2023-06-02 20:35 wessf 阅读(6) 评论(0) 推荐(0) 编辑

将int类型转换为char类型
摘要:>将int类型转换为char类型 ```c #include #include int main() { int a=1234567; char b[10]={0}; int i=0; while(a) { b[i]=a%10+'0'; i++; a=a/10; } while(i) { print 阅读全文

posted @ 2023-06-01 20:56 wessf 阅读(183) 评论(0) 推荐(0) 编辑

将char类型转换为int类型
摘要:>将char类型转换为int类型 ```c #include int main() { char a[12]="123456"; int i=0; int j=0; while(a[i]!=0) { j=j*10+a[i]-'0'; i++; } printf("%d\n",j); return 0 阅读全文

posted @ 2023-06-01 20:56 wessf 阅读(62) 评论(0) 推荐(0) 编辑

打出下划线加字母
摘要:>打出下划线加字母 ```c #include int main() { int i,j,a; char b='F'; for(i=0;i<6;i++) { for(j=1;j<=i;j++) { printf("_"); } for(a=0,b='F';a<=i;a++) { printf("%c 阅读全文

posted @ 2023-06-01 20:55 wessf 阅读(46) 评论(0) 推荐(0) 编辑

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

统计

点击右上角即可分享
微信分享提示