C语言程序设计大题1

C语言程序设计大题1,第1张

C语言程序设计大题1


#include
void  TestFunc(); 



int average_num(double a[],int n,double b[])
{
  
  
  
  
  
  
  
  
}


main()
{
  double a[100],b[100];  int n,i,num;
  printf("input n:");
  scanf("%d",&n);
  printf("input %d data:n",n);
  for(i=0;i 

答案

int i,m=0;
  double avg=0;
  for(i=0;ia[i])
		  b[m++]=a[i];
	
  return m;

2

#include "stdio.h"
#include "string.h"
#include "conio.h"
#define N 81

void fun(char *str,int n)
{                
  
  
  
  
  
  
  
  
  
  
}
TestFunc()
{
  FILE *IN,*OUT;
  char sIN[20],*sOUT;
  int iLENGTH;
  IN=fopen("in.dat","r");
  if(IN==NULL)
  {
    printf("Please Verify The Currernt Dir..It May Be Changed");
  }
  OUT=fopen("out.dat","w");
  if(OUT==NULL)
  {
    printf("Please Verify The Current Dir.. It May Be Changed");
  }
  fscanf(IN,"%s",sIN);
  iLENGTH=strlen(sIN);
  sOUT=sIN;
  fun(sIN,iLENGTH);
  fprintf(OUT,"%sn",sOUT);
  fclose(IN);
  fclose(OUT);
} 
main()
{
  char s [N];
  int l;
  printf("input a string:");gets(s);
  l=strlen(s);
  fun(s,l);
  printf("The new string is :");puts(s);
  TestFunc();
}

答案

int i,j;
 char c;
for(i=0,j=n-1;i					
										


					

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/zaji/5611459.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-12-15
下一篇 2022-12-15

发表评论

登录后才能评论

评论列表(0条)

保存