2013下半年福建高等学校非计算机专业学生计算机二级c语言原题,福建省高等学校计算机等级考试二级C语言编程题...

《福建省高等学校计算机等级考试二级C语言编程题》由会员分享,可在线阅读,更多相关《福建省高等学校计算机等级考试二级C语言编程题(21页珍藏版)》请在人人文库网上搜索。

1、double fun1(double x) /*/ double f; f=(1+sin(x)+exp(x)/(1+x); return f; /*/ void main() clrscr(); printf(un1 = %n, fun1); printf(un1 = %n, fun1); printf(un1 = %n, fun1); 12打开考生文件夹中的,完成其中的函数fun2(int a ,int n,int b ,int c ),实现: 1)将数组a中大于20的元素依次存放在数组b中; 2)将数组b中的元素按照从小到大的顺序依次存放到数组c中; 3)函数返回数组b中的元素个数。 #i。

2、nclude #include int fun2(int a,int n,int b,int c) /*/ int nb=0; int i,j=0,temp; for(i=0;i-20) bj=ai;nb+;j+; for(i=0;icj+1) temp=cj; cj=cj+1; cj+1=temp; return nb; /*/ void main() int n = 10, i, nb; int aa10 = 12, -10, -31, -18, -15, 50, 17, 15, -20, 20; int bb10, cc10; clrscr(); printf(There are - e。

3、lements in aa.n, n); printf(They are: ); for(i=0; i #include #include #include 0) strcpy(temp,a);strcpy(a,b); strcpy(b,temp); if(strcmp(a,c)0) strcpy(temp,a);strcpy(a,c); strcpy(c,temp); if(strcmp(b,c)0) strcpy(temp,b);strcpy(b,c); strcpy(c,temp); /*/ void main() char str115=Fuzhou,str215=Fujian,str。

4、315=China; clrscr(); fun2(str1,str2,str3); printf(The ordered strings is : %s, %s, %sn,str1,str2,str3); getch(); 31打开完成其中的函数fun1,该函数的数学表达式是: 当x3时 例如: fun1= fun1= fun1= #include double fun1(double x) /*/ double f; if(x int fun(char *s) /*/ int i,n=0; for(i=0 ; si!=0;i+) if(si= ) n+; return n; /*/ voi。

5、d main() char str255; gets(str); printf(%dn,fun(str); 41打开程序,完成其中的f( )函数,使其计算: 如 输入:12 输出:f= 输入: 输出:f= 输入: 输出:f= #include double f(float x) /*/ double f; if(x #include #include #include #include #include float fun(float a,char flag,float b) /*/ float f; switch(flag) case +: f=a+b; break; case -: f=a。

6、-b; break; case *: f=a*b; break; case /: f=a/b; break; return f; /*/ void main() float a,b; printf(Please input two numbers:n); scanf(%f%f,&a,&b); printf(%.2f+%.2f=%.2fn,a,b,fun(a,+,b); printf(%.2f-%.2f=%.2fn,a,b,fun(a,-,b); printf(%.2f*%.2f=%.2fn,a,b,fun(a,*,b); printf(%.2f/%.2f=%.2fn,a,b,fun(a,/,b); getch();。

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值