2017年9月18日

编写函数fun,其功能是求出小于或等于lim的所有素数并放在aa数组中,并返回所求出的素数的个数

摘要: #include #include #include #define MAX 100 int fun(int lim, int aa[MAX]) { int i,j,k=0; for(i=2;i(i/2)) aa[k++]=i; } return k; } void main() { FILE *wf; int limit,i,sum; int aa[MAX]; syste... 阅读全文

posted @ 2017-09-18 09:54 jun俊 阅读(6677) 评论(0) 推荐(0)

2017年9月16日

编写函数fun,计算n!

摘要: #include <stdio.h> double fun ( int n ){ double result = 1.0 ;/************found************/ if (n==0) return 1.0 ; while( n >1 && n < 170 )/******** 阅读全文

posted @ 2017-09-16 17:36 jun俊 阅读(3825) 评论(0) 推荐(0)

编写函数fun,将一个数字字符串转换为一个整数,例如,输入字符串"-1234",则函数把他转换为整数值-1234

摘要: #include #include long fun ( char *p) { int len,t; long x=0; len=strlen(p); if(p[0]=='-') {t=-1;len--;p++;} else t=1; while(*p) x=10*x+(*p-48),p++; return x*t; } main() /* 主函数 */ { char s[6]... 阅读全文

posted @ 2017-09-16 15:42 jun俊 阅读(11809) 评论(0) 推荐(0)

2017年9月15日

编写函数fun,功能是计算下列级数和,和值由函数值返回,s=1+x+x^2/2!+......+x^n/n!,当n=10,x=0.3,函数值为1.349859

摘要: #include #include #include #include double fun(double x, int n) { int i; double s=1.0,k=1.0; for(i=1;i<=n;i++) { k=k*i; s=s+pow(x,i)/k; } return s; } void main() { FILE *... 阅读全文

posted @ 2017-09-15 21:28 jun俊 阅读(7210) 评论(0) 推荐(0)

2017年9月14日

N名学生的成绩已经在主函数中放入一个带有头结点的链表结构中,h指向链表的头结点,编写函数fun,其功能是:找出学生的最高分,并由函数值返回

摘要: #include #include #define N 8 struct slist { double s; struct slist *next; }; typedef struct slist STREC; double fun( STREC *h ) { double max=h->s; while(h!=NULL) { if(maxs) max=h-... 阅读全文

posted @ 2017-09-14 21:42 jun俊 阅读(1417) 评论(0) 推荐(0)

2017年9月12日

1、什么是RUP 2、什么是XP 3、什么是敏捷过程

摘要: 1、RUP(Rational Unified Process,统一软件开发过程,统一软件过程)是一个面向对象且基于网络的程序开发方法论。 瑞理统一过程(RUP)是Rational软件公司(Rational公司被IBM并购)创造的软件工程方法。RUP描述了如何有效地利用商业的可靠的方法开发和部署软件,是一种重量级过程(也被称作厚方法学),因此特别适用于大型软件团队开发大型项目。 2、极限编程(E... 阅读全文

posted @ 2017-09-12 10:33 jun俊 阅读(299) 评论(0) 推荐(0)

2017年9月11日

函数fun的功能是将形参给定的字符串、整数、浮点数写到文本文件中,再用字符方式从此文本文件中逐个读入并显示在屏幕上

摘要: #include void fun(char *s, int a, double f) { /**********found**********/ FILE* fp;//定义文本文件类型 char ch; fp = fopen("file1.txt", "w"); fprintf(fp, "%s %d %f\n", s, a, f); fclose(fp); ... 阅读全文

posted @ 2017-09-11 20:40 jun俊 阅读(841) 评论(0) 推荐(0)

2017年9月10日

编写函数fun,其功能是计算并输出如下多项式的值,sn=1+1/2!+1/3!+...+1/n!,例如,主函数从键盘输入15,输出的值是1.718282

摘要: #include double fun(int n) { double sn=0.0,t; int i,j; for(i=0;i<=n;i++){ t=1.0; for(j=0;j<=i;j++) t=t*j; sn=sn+t; } return sn; } 阅读全文

posted @ 2017-09-10 17:04 jun俊 阅读(2771) 评论(0) 推荐(0)

2017年9月7日

编写fun,删除字符串中所有的*号,不得使用c语言提供的字符串函数

摘要: #include void fun( char *a ) { int i,j=0; for(i=0;a[i]!='\0';i++) if(a[i]!='*') a[j++]=a[i]; /*若不是要删除的字符'*'则留下*/ a[j]='\0'; } main() { char s[81]; void NONO ( ); pr... 阅读全文

posted @ 2017-09-07 12:32 jun俊 阅读(1034) 评论(0) 推荐(0)

2017年9月6日

helloworld

摘要: #include<stdio.h> void main() { printf("helloworld!\n"); } 阅读全文

posted @ 2017-09-06 21:20 jun俊 阅读(65) 评论(0) 推荐(0)

导航