上一页 1 ··· 9 10 11 12 13 14 15 16 17 ··· 27 下一页
摘要: //选择法(10个数从小到大)排序 #include<stdio.h> #define N 10 int main(){ int a[10]; int i,j,k; printf("请输入10个数:\n"); for(i=0;i<10;i++){ scanf("%d",&a[i]); } for(i 阅读全文
posted @ 2020-08-18 22:33 薄眠抛却陈年事。 阅读(1470) 评论(0) 推荐(0) 编辑
摘要: //冒泡法(10个数从小到大排序) #include <stdio.h> int main(){ int a[10]; int i,j,k; printf("请输入10个数:\n"); for(i=0;i<10;i++){ scanf("%d",&a[i]); } for(i=0;i<10;i++) 阅读全文
posted @ 2020-08-18 22:30 薄眠抛却陈年事。 阅读(2757) 评论(0) 推荐(0) 编辑
摘要: //输出以下图案 #include<stdio.h> int main(){ int i,j,k; for(i=0;i<=3;i++){ for(j=0;j<=2-i;j++){ printf(" "); } for(k=0;k<=2*i;k++){ printf("*"); } printf("\ 阅读全文
posted @ 2020-08-18 20:09 薄眠抛却陈年事。 阅读(284) 评论(0) 推荐(0) 编辑
摘要: //使用尾插法创建链表并且输出 #include<stdio.h> #include<stdlib.h> #include<malloc.h> #define LEN sizeof(struct Student) struct Student{ long long num; float score; 阅读全文
posted @ 2020-08-18 20:01 薄眠抛却陈年事。 阅读(285) 评论(0) 推荐(0) 编辑
摘要: //使用尾插法创建链表并输出 #include<stdio.h> #include<stdlib.h> #include<malloc.h> #define LEN sizeof(struct Student) struct Student{ long long num; float score; 阅读全文
posted @ 2020-08-18 19:58 薄眠抛却陈年事。 阅读(276) 评论(0) 推荐(0) 编辑
摘要: /* a是一个3*4的整型数组。函数max_value求最大值max,请编写max_value函数和 main()函数,在main()函数中调用max_value函数求出3*4的整型数组的最大值并输出结果 */ #include <stdio.h> int max_value(int a[][4], 阅读全文
posted @ 2020-07-28 12:35 薄眠抛却陈年事。 阅读(414) 评论(0) 推荐(0) 编辑
摘要: //输入10个整数,按照从小到大进行排序 #include <stdio.h> # define N 10 void sort(int a[],int n){ int i,j; for(i=0;i<n-1;i++){ int k=i; for(j=i+1;j<n;j++){ if(a[k]>a[j] 阅读全文
posted @ 2020-07-28 12:00 薄眠抛却陈年事。 阅读(2218) 评论(0) 推荐(0) 编辑
摘要: #include <stdio.h> /* 设计一个函数,把数字字符串转化成整数 */ int integer(char str[]){ int i,num; num=0; for(i=0;str[i]!='\0';i++){ if(str[i]<='9'&&str[i]>='0') num=num 阅读全文
posted @ 2020-07-28 11:40 薄眠抛却陈年事。 阅读(675) 评论(0) 推荐(0) 编辑
摘要: /* 求解数列1+1/(1+2)+1/(1+2+3)+...... */ #include <stdio.h> double fun(int n){ double s=0; int i,a=0; for(i=1;i<=n;i++){ a=a+i; s=s+1.0/a; } return s; } i 阅读全文
posted @ 2020-07-27 18:50 薄眠抛却陈年事。 阅读(800) 评论(0) 推荐(0) 编辑
摘要: /* 给出一个不多于5位的正整数 要求:(1)求出它是几位数; (2)分别输出每一位数字 (3)按照逆序*/ #include <stdio.h> #include <string.h> int main(){ char str[50]; scanf("%s",str); int i=0,count 阅读全文
posted @ 2020-07-27 18:42 薄眠抛却陈年事。 阅读(820) 评论(0) 推荐(0) 编辑
上一页 1 ··· 9 10 11 12 13 14 15 16 17 ··· 27 下一页