2013年c语言末考试题,c语言期末考试试题,c语言期末考试题库,c语言期末考试,大一c语言期末考试,北航c语言期末考试,大一c语言期末试题,c语言期末试题,c语言期末试题及答案,c语言二级考试真题
1、给定n个数据, 求最小值出现的位置(如果最小值
出现多次,求出第一次出现的位置即可)。
f2=f3;
s=s=f2/f1;}
return s;
83功能:从键盘上输入任意实数,求出其所对应的函数值。
z=e的x次幂(x>10)
z=log(x+3) (x>-3)
z=sin(x)/((cos(x)+4)
答案:double z;
If(x>10)z=log(x+3)
else if(x > -3)z=log(x+3);
else z=sin(x)/(cos(x)+4);
return(z);
84题目:用函数求一个N阶方阵右下三角元素的和(包括副
对角线上的元素)。
int I,j,k=0;
for(i=0;i
for(j=N-1-I;j
k=k+a[i][j];
return(k);
85功能:用函数实现字符串的复制, 不允许用strcpy()函数。
int i;
for(i=0;str1[i]!=’\0’;i++)
str2[i]=str1[i];
str2[i]=’\0’
86功能:将字符串中的小写字母转换为对应的大写字母,
其它字符不变。
inti;
for(i=0;str[i]!=’\0’;i++)
if(str[i]>&#61;’a’&&str[i]<&#61;’z’)
str[i]&#61;str[i]-32
87功能&#xff1a;编写函数fun其功能是&#xff1a;根据整型形参m&#xff0c;计算如下
公式的值&#xff1a;y&#61;1/2!&#43;1/4!&#43;...&#43;1/m!(m是偶数)
int I,j;
double s&#61;1;
for(i&#61;2;i<&#61;m;i&#43;&#61;2)
{for(j&#61;i-1;j<&#61;I;j&#43;&#43;)
s&#61;s*j;
y&#61;y&#43;1.0/s;
} return y ;
88功能&#xff1a;能计算从1开始到n的自然数中偶数的平方的和&#xff0c;n由
键盘输入&#xff0c;并在main()函数中输出。(n是偶数)
int sum,I;
sum&#61;0;
for(i&#61;2;i<&#61;n;i&#61;i&#43;2)
{ sum&#61;sum&#43;i*I;}
return(sum)
89功能&#xff1a;根据整型形参m&#xff0c;计算如下公式的值&#xff1a;
y&#61;1/5&#43;1/6&#xff0b;1/7&#xff0b;1/8&#xff0b;1/9&#43;1/10...&#xff0b;1/(m&#43;5)
例如&#xff1a;若m&#61;9&#xff0c;则应输出&#xff1a;1.168229
double y&#61;0;
int I;
for(i&#61;0;i<&#61;m;i&#43;&#43;)
{y&#43;&#61;1.0/(i&#43;5);}
Return(y);
90功能&#xff1a;编写函数fun求一个字符串的长度,在main函数中
输入字符串,并输出其长度。
char *p;
int n&#61;0;
p&#61;p1;
while(*p&#43;&#43;)
n&#43;&#43;;
return n;
relationship between Government and business. The "two sessions", General Secretary of "Pro", "clear" the word succinctly summarized the new relationship between Government and business, as pure politics, reshaping the political relationship specified in the direction. District leaders in handling political and business relations, engage in trading power for money, and finally stumbled, we a lesson, always keep in mind that "Pro", "clean" practicing "Pro", "clear". "Pro" is to open a sincere engagement with private enterprise to help solve practical difficulties; " Clear "is to clarify the Division of power, exercised in accordance with, private entrepreneurs with innocent purity, not abusing power for personal gain, not to engage in trading power for money. Third, in order to maintain fairn