二级24套

blank
#include <stdio.h>
double f1(double x)
{ return xx; }
double f2(double x, double y)
{ return x
y; }
/found/
double fun(int i, double x, double y)
{ if (i==1)
/found/
return f1(x);
else
/found/
return f2(x, y);
}
void main()
{ double x1=5, x2=3, r;
r = fun(1, x1, x2);
r += fun(2, x1, x2);
printf("\nx1=%f, x2=%f, x1x1+x1x2=%f\n\n",x1, x2, r);
}
modi
#include <conio.h>
#include <stdio.h>
/found*/
char fun( char s,char t)
{
int s1=0,t1=0;
char ss,tt;
ss=s;
tt=t;
while(ss)
{
s1++;
/found
/
ss++;
}
while(tt)
{
t1++;
/found
/
tt++;
}
if(t1>s1)
return t;
else
return s;
}
void main()
{
char a[80],b[80];
printf("\nEnter a string : “);
gets(a);
printf(”\nEnter a string again: “);
gets(b);
printf(”\nThe longer is :\n\n%s\n", fun(a,b));
}
prog
#include <stdio.h>
#include <string.h>
#define N 80
void fun (char w,int m)
{
int i,j;
char t;
for(i=1;i<=m;i++)
{t=w[0];
for(j=1;w[j]!=’\0’;j++)
w[j-1]=w[j];
w[j-1]=t;
}
}
void main()
{
FILE wf;
char a[N]= “ABCDEFGHIJK”,b[N]= “ABCDEFGHIJK”;
int m;
printf(“The origina string :\n”);
puts(a);
printf("\n\nEnter m: “);
scanf(”%d",&m);
fun(a,m);
printf("\nThe string after moving :\n");
puts(a);
printf("\n\n");
/
/
wf=fopen(“out.dat”,“w”);
fun(b,3);
fprintf(wf,"%s",b);
fclose(wf);
/
******/
}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值