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]>=’a’&&str[i]<=’z’)
str[i]=str[i]-32
87功能:编写函数fun其功能是:根据整型形参m,计算如下
公式的值:y=1/2!+1/4!+...+1/m!(m是偶数)
int I,j;
double s=1;
for(i=2;i<=m;i+=2)
{for(j=i-1;j<=I;j++)
s=s*j;
y=y+1.0/s;
} return y ;
88功能:能计算从1开始到n的自然数中偶数的平方的和,n由
键盘输入,并在main()函数中输出。(n是偶数)
int sum,I;
sum=0;
for(i=2;i<=n;i=i+2)
{ sum=sum+i*I;}
return(sum)
89功能:根据整型形参m,计算如下公式的值:
y=1/5+1/6+1/7+1/8+1/9+1/10...+1/(m+5)
例如:若m=9,则应输出:1.168229
double y=0;
int I;
for(i=0;i<=m;i++)
{y+=1.0/(i+5);}
Return(y);
90功能:编写函数fun求一个字符串的长度,在main函数中
输入字符串,并输出其长度。
char *p;
int n=0;
p=p1;
while(*p++)
n++;
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