#include< stdio.h>
int main(void)
{
int i,x[ ]=1,3,5,7,9,11,13,15},*p=x+3
for(i=3;i;i--)
switch(i)
}
case 1:
case2: printf("%d", *p++);break;
case3: printf("%d ",*(--p));
return 0;
编写函数fun求n!,并调用该函数计算的近似值,直到公式中最后一项的值小于10-6为止。
利用循环输出如下形式的数字三角形。
1
12
123
…………
123456789
从键盘输入10个学生的学号、年龄和姓名,计算并输出所有学生的平均年龄。
#define N 10
struct student
long int num;
int age;
char name[20]
}stu[N]
int i, sum =0, aver;
for(i=0; i<N;i++
scanf("%d% d%s", &stu[ i]. num, ________);/*第一空*/
sum= sum+ ____________;/*第二空*/
aver=sum/____________ ;/*第三空*/
printf("%d\n",aver);
利用冒泡法实现数组元素值降序排序并输出。
#include
int a[7]={4,7,2,8,5,9,1},i,j,tem;
for(i=7;i>1;i--)
for(j=0;j<i-1;j++)
if(__________ ) /*第一空*/
tem =a[j];
_____________;/*第二空*/
_____________;/*第三空*/
for (i=0; i<=6; i++) printf("%5d", a[i]);
printf("\n");
从键盘输入一字符串,调用函数 revstr将其反向输出。(例如输入字符串"abcde",输出其反向字符串"edcba")
#include< string.h>
void revstr( char *s)
int j;
for(j =strlen(s)-1 ;j>=0; j--)
printf("%c", __________);/*第一空*/
char str[10];
scanf("%s",___________ )/*第二空*/
__________; /*第三空*/
int fun(int x)
int y;
if(x==0 ‖ x==1)return 3;
y=x *x-fun(x-2);
return y;
int main( void)
int z;
z=fun(3);
printf("%d\n",z);
int i=1, s =3;
do
s+=i++;
if( s%==0) continue;
else++i;
} while(s<15);
printf("%d\n",i);
char s[2][6];
strepy([0],"Jerry");
strepy ([1], "Tom");
s[0][5]='&';
printf("%s\n",s);
C语言变量的存储类型分为auto型 register型、 extern型和_______。
热门试卷
经济师初级(经济基础知识)模拟试卷5
经济师初级经济基础知识(商品经济的基
经济师(初级)工商管理专业知识与实务
初级经济师试题及答案3(公路运输)
经济师初级人力资源管理专业知识与实务
初级经济师《工商专业》全真模拟试卷(
初级经济师《经济基础知识》考前突破试
订单号:
遇到问题请联系在线客服