- 0
- 0
- 约1.17万字
- 约 19页
- 2017-12-26 发布于河南
- 举报
C学生复习(2015.1.6)-习题一-
单项选择题题编程题看程序写结果
?# include stdio.h ??????
?void find(int *a,int n,int *max,int *min) ??????
?{????
int i;
?? *max=*min=0; ??????????
?? for(i=1;in;i++) ?????????????
if(a[i]a[*max]) ?????? ? ??? ????
????? *max=i+1? ; ???????????????????
? else ?if(a[i]a[*min]) ???????????????????? ? ??
; ?????????????
? return; ??????
?}
void main( ) ??????
?{????
int x[ ]={5,18,12,1,31,-4}; ????????????
? int max,min; ?????????????
find(?x,6, max,min ); ???????????
?? printf(\n max=%d,min=%d,max,min);
? }
读程序,输出的值是main()??
{
int a,b,c,d,x;
a=13,b=54,c=81,d=172;
if (ab)
if (cd) x=10;
else if (ac)
? ? if (bd) x=9;
? ?else x=11;
? ?else x=12;
else x=13;
printf(“x=%\d”,x);
}
3、#include stdio.h
void main()
{
int n,i,k,m;
for(n=33;n=120;n=n+2)
{ k=sqrt(n);
for (i=2;i=k;i++)
if (n%i==0) break;
if (i=k+1)
{ printf(%d ,n);
m=m+1;
}
if(m%10==0) printf(“\n”);
}
4、#includestdio.h
int x1=630,x2=710;
void main()
{
int x3=80,x4=90;
x3=x3-x4;
x2=x2/x1;
printf(“%d,%d,%d,%d\n”,x3,x4,x1,x2);
}
5、void main()
{
int num =9341,num1,num2;
while (--num) ;
num +=40;
num1=num%3;
num2=num/6;
printf(num=%d\n,num);
printf(num=%d\n,num1);
printf(num=%d\n,num2);
}
6.设整型变量n的值为2,执行语句n+=n-=n*n;后,n的值是( )。
A)0 B)4 C) - 4 D) 2
sizeof(float)的结果值是( ) struct node {
int len;
char *pk;
} x = {2, right}, *p = x;
A、p-pk B、*p.pk C、*p-pk D、*x.pk
10.运行结果是void main ( )
???? {???? int a[3][3]={10,20,30,40,50,60,70,80,90};
??????????? int s=0,i;
??????????? for (i=0;i3;i++)
??????????? ?????? s+=(*(a+i))[i];
??????????? printf(%d,s);
???? }
#define f(a, b, x) a*x+b
printf(%d, %dn, f(3,2,1), f(6, 5, f(3, 2, 1)));
12 下列程序段的输出是___ __。
char *a[2]={book, see}, **p=a;
printf(%s,, *(p++)+1);
printf(%cn, **p
您可能关注的文档
- 2015年12月英语六级考试真题(第二套).doc
- 2016年初一信息技术考试考纲.doc
- 2016马克思主义基本原理模拟考试.docx
- 2016年北师大版5下数学期末复习单元知识点梳理-可填空.doc
- 重庆考试院发布的考生填报志愿须知.doc
- 影视鉴赏课后习题.docx
- 2015年中考英语试题(word版-含答案).doc
- 5数课堂观察材料.docx
- 02-城南分公司燃气管道保护方案模板(庭院类).doc
- 苏州科技大学设计模式设计报告.doc
- 2025-2026学年天津市和平区高三(上)期末数学试卷(含解析).pdf
- 2025-2026学年云南省楚雄州高三(上)期末数学试卷(含答案).pdf
- 2025-2026学年甘肃省天水市张家川实验中学高三(上)期末数学试卷(含答案).docx
- 2025-2026学年福建省厦门市松柏中学高二(上)期末数学试卷(含答案).docx
- 2025-2026学年广西钦州市高一(上)期末物理试卷(含答案).docx
- 2025-2026学年河北省邯郸市临漳县九年级(上)期末化学试卷(含答案).docx
- 2025-2026学年河北省石家庄二十三中七年级(上)期末历史试卷(含答案).docx
- 2025-2026学年海南省五指山市九年级(上)期末化学试卷(含答案).docx
- 2025-2026学年河北省唐山市玉田县九年级(上)期末化学试卷(含答案).docx
- 2025-2026学年河北省邢台市市区九年级(上)期末化学试卷(含答案).docx
原创力文档

文档评论(0)