- 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
- 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 4、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 5、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 6、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 7、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
2012年福建省C语言二级考试大题及答案
编程题
#include stdio.h
#include math.h
double fun(float t)
{ /**/
double y=0.0;
if(t2) y=3.1*t+2;
else if(t==2) y=3.1;
else y=5*t-8.6;
return y;
/**/
}
void main()
{ float t;
printf(Input t :);
scanf(%f,t);
printf(fun(%.3f)=%.3lf\n,t,fun(t));
getch();
}
#include stdio.h
#include math.h
double fun(float s)
{ /**/
double y=0.0;
if(s30) y=1.36*s;
else if(s=30s50) y=40.8+1.632*(s-30);
else y=68+2.176*(s-50);
return y;
/**/
}
void main()
{ float s;
printf(Input s :);
scanf(%f,s);
printf(fun(%.3f)=%.3lf\n,s,fun(s));
getch();
}
#include stdio.h
#include math.h
int fun(int a,int b,int c)
{ /**/
int y=0;
if(a+bca+cbb+ca)
if((a==b)(b!=c)||(b==c)(b!=a)||(a==c)(a!=b))
y=1;
else if((a*a==b*b+c*c)||(b*b==a*a+c*c)||(c*c==a*a+b*b))
y=2;
return y;
/**/
}
void main()
{ int a,b,c;
int ans;
printf(please input a,b,c:);
scanf(%d%d%d,a,b,c);
ans=fun(a,b,c);
if(ans==1)
printf(\n It is an isosceles triangle.);
else if(ans==2)
printf(\n It is an right triangle.);
else
printf(\n Neither.);
getch();
}
#include stdio.h
#include math.h
double fun1(float x)
{/**/
double y=0.0;
if(x1) y=x;
else if(x=1x10) y=sqrt(2*x+1);
else y=log(3*x);
return y;
/**/
}
void main()
{ float x;
printf(Input x :);
scanf(%f,x);
printf(fun1(%.3f)=%.3lf\n,x,fun1(x));
getch();
}
#include stdio.h
#include math.h
double fun(double x)
{ /**/
double y;
y=(0.16*(pow(x,2)-5.8)*cos(2*x))/(pow(x,2)+1.2+fabs(sin(x)));
return y;
/**/
}
void main()
{ printf(fun(2.7) = %7.3lf\n, fun(2.7));
getch();
}
#include stdio.h
#include math.h
double fun(float t)
{ /**/
double y=0.0;
if(t2) y=3.1*t+2;
else if(t= =2) y=3.1;
else y=5*t-8.6;
return y;
/**/
}
void main()
{ float t;
printf(Input t :);
scanf(%f,t);
printf(fun(%.3f)=%.3lf\n,t,fun(t));
getch();
}
#include stdio.h
#include math.h
int isprime(int n)
{ /**/
int i,k,a=1;
k=sqrt(n);
for(i=2;i=k;i++)
if(n%i==0) a=0;
return a;
/**/
}
void main()
{ int i,k=0;
for(i=100;i=
您可能关注的文档
最近下载
- 一种窄冠带条多层缠绕搭接量计算方法及应用.pdf VIP
- 2025年融媒体中心全媒体记者招聘考试笔试试题(附答案).docx VIP
- L10010022《病理学》课程标准.pdf VIP
- 【必备收藏】幼儿建构区游戏指导完整版课件-.pptx VIP
- 主题策略-【专题报告】CANSLIM4.0策略:叠加企业生命周期.docx VIP
- 最新人教版九年级化学演示、分组实验统计表.xls VIP
- GB 50797-2012 光伏发电站设计规范.docx VIP
- 插画设计-PPT课件(全).pptx
- 古代牝户手抄本雨花香PPT课件.pptx VIP
- 【大单元整体教学设计】人教版初中化学九年级上册 第三单元物质构成的奥秘 课题1 分子和原子.doc VIP
文档评论(0)