如有你有帮助,请购买下载,谢谢!
#include
void fun(char *a,char *h,char *p) {char b[81],*x; int i=0,j=0; x=a;
while (x if (*h!='*') {b[j]=*h;j++;h++;} else h++; p++; while (*p) {b[j]=*p;j++;p++;} b[j]='\\0';j=0; while (b[j]) { a[i]=b[j];i++;j++;} a[i]='\\0'; } main() { char s[81],*t,*f; printf(\ t=f=s; while(*t) t++; t--; while (*t=='*') t--; while (*f=='*') f++; fun(s,f,t); printf(\ NONO(); } 2 #include double fun ( double eps) { int n=0; double down=1,up=1; double one ,pi=0; one = (double)up/(double)down; while(one>=eps) { pi+=one; n++; up=up*n; down=down*(2*n+1); one=(double)up/(double)down; 1页 如有你有帮助,请购买下载,谢谢! } return pi*2; } main( ) { double x; printf(\ scanf(\ NONO(); } 3 #include char *fun ( char *s, char *t) { int first=0,second=0; char *p,*q; p=s; q=t; while(*p++!='\\0') first++; while(*q++!='\\0') second++; if(first==second) return s; else if (first>second) return s; else return t; } main( ) { char a[20],b[10]; printf(\ gets( a); printf(\ gets( b); printf(\ NONO (); } 4 #include int i=0,j=0,s=0,k; while (a[i]=='*') {s++;i++;} 2页 如有你有帮助,请购买下载,谢谢! if (s>n) { for (k=0;k { a[i]=b[j];i++;j++;} a[i]='\\0'; } } main() { char s[81];int n; printf(\ printf(\ \ fun(s,n); printf(\ NONO(); } 5 #include float fun ( float *a , int n ) { int i; float average; double sum=0; for(i=0;i average=(float)sum/n; return average; } main() { float score[30]={90.5, 72, 80, 61.5, 55}, aver; aver = fun( score, 5 ); printf( \ is: %5.2f\\n\ NONO ( ); } 6 #include { char num[10]; double s[N]; double ave; 3页
相关推荐: