2019年6月25日
摘要: 1拆分实数的整数与小数部分: #include<stdio.h>void splitfloat(float x,int * intpart,float * fracpart);int main(void){ float x; int intpart; float fracpart; printf(" 阅读全文
posted @ 2019-06-25 18:00 马青林 阅读(150) 评论(0) 推荐(0)
  2019年6月19日
摘要: 第1题 /*拆分实数的整数和小数部分:要求自定义一个函数void splitfloat(float x,int*intpart,float*fracpart),其中x是拆分出来的实数,*intpart和*fracpart分别是将实数x拆分出来的整数部分与小数部分。编写主函数,并在其中调用函数 spl 阅读全文
posted @ 2019-06-19 20:55 马青林 阅读(192) 评论(0) 推荐(0)
  2019年6月11日
摘要: 实验代码: /*杨辉三角*/#include<stdio.h>int main(){int i,j,n;int a[100][100];printf("输入n行:"); /*输入杨辉三角的行数*/scanf("%d",&n);a[0][0]=1; /*第一行,第一列为1*/for(i=0;i<n;i 阅读全文
posted @ 2019-06-11 20:21 马青林 阅读(107) 评论(1) 推荐(0)
  2019年6月10日
摘要: 第1题:/*选择法排序。输入一个正整数n(1<n<=10),再输入n个整数,将他们从大到小排序后输出。试编写相应程序。*/#include<stdio.h>int main (void){int i,index,k,n,t;int a[10];printf("enter n:");scanf("%d 阅读全文
posted @ 2019-06-10 22:05 马青林 阅读(119) 评论(0) 推荐(0)
  2019年5月28日
摘要: 3.使用函数输出指定范围内的完数:输入两个正整数m和n(1<=m,n<=1000),输出m~n之间所有的完数,完数就是因子和与他本身相等的数。要求定义并调用函数factorsum( number),它的功能是返回number的因子和。例如,factorsum(12)的返回值是16(1+2+3+4+6 阅读全文
posted @ 2019-05-28 21:23 马青林 阅读(162) 评论(1) 推荐(0)
  2019年5月8日
摘要: #include<stdio.h> #include<math.h> int prime(int m); int main() { int m,n,sum,count; printf("m n\n"); scanf("%d%d",&m,&n); sum=0; count=0; for(m;m<=n; 阅读全文
posted @ 2019-05-08 21:10 马青林 阅读(99) 评论(1) 推荐(0)
  2019年4月15日
摘要: 算法的不熟练,确定不了语句;考虑问题不全面 阅读全文
posted @ 2019-04-15 22:58 马青林 阅读(117) 评论(1) 推荐(0)
  2019年4月10日
摘要: #include"stdio.h"#include"math.h"int main(void){ double x1,x2,y1,y2,x3,y3,a,b,c,s,C,area;printf("Enter x1 x2 x3 y1 y2 y3\n");scanf("%lf%lf%lf%lf%lf%lf 阅读全文
posted @ 2019-04-10 22:36 马青林 阅读(117) 评论(1) 推荐(0)
  2019年3月31日
摘要: 阅读全文
posted @ 2019-03-31 17:48 马青林 阅读(107) 评论(0) 推荐(0)
  2019年3月19日
摘要: 阅读全文
posted @ 2019-03-19 23:45 马青林 阅读(102) 评论(0) 推荐(0)