C语言模拟题库改1Word格式.docx

上传人:b****2 文档编号:6123476 上传时间:2023-05-06 格式:DOCX 页数:48 大小:832.87KB
下载 相关 举报
C语言模拟题库改1Word格式.docx_第1页
第1页 / 共48页
C语言模拟题库改1Word格式.docx_第2页
第2页 / 共48页
C语言模拟题库改1Word格式.docx_第3页
第3页 / 共48页
C语言模拟题库改1Word格式.docx_第4页
第4页 / 共48页
C语言模拟题库改1Word格式.docx_第5页
第5页 / 共48页
C语言模拟题库改1Word格式.docx_第6页
第6页 / 共48页
C语言模拟题库改1Word格式.docx_第7页
第7页 / 共48页
C语言模拟题库改1Word格式.docx_第8页
第8页 / 共48页
C语言模拟题库改1Word格式.docx_第9页
第9页 / 共48页
C语言模拟题库改1Word格式.docx_第10页
第10页 / 共48页
C语言模拟题库改1Word格式.docx_第11页
第11页 / 共48页
C语言模拟题库改1Word格式.docx_第12页
第12页 / 共48页
C语言模拟题库改1Word格式.docx_第13页
第13页 / 共48页
C语言模拟题库改1Word格式.docx_第14页
第14页 / 共48页
C语言模拟题库改1Word格式.docx_第15页
第15页 / 共48页
C语言模拟题库改1Word格式.docx_第16页
第16页 / 共48页
C语言模拟题库改1Word格式.docx_第17页
第17页 / 共48页
C语言模拟题库改1Word格式.docx_第18页
第18页 / 共48页
C语言模拟题库改1Word格式.docx_第19页
第19页 / 共48页
C语言模拟题库改1Word格式.docx_第20页
第20页 / 共48页
亲,该文档总共48页,到这儿已超出免费预览范围,如果喜欢就下载吧!
下载资源
资源描述

C语言模拟题库改1Word格式.docx

《C语言模拟题库改1Word格式.docx》由会员分享,可在线阅读,更多相关《C语言模拟题库改1Word格式.docx(48页珍藏版)》请在冰点文库上搜索。

C语言模拟题库改1Word格式.docx

=0)

m1=n1;

n1=a;

最大公约数是%d\n"

n1);

最小公倍数%d\n"

m*n/n1);

程序改错题:

#include<

main()

{

floata[4][4],t;

inti,j;

printf("

Input4*4numbers:

for(i=0;

i<

4;

for(j=0;

j<

j++)

/************found************/

%d"

a[i][j]);

t=a[i][i];

a[i][j]*=temp;

%.2f"

a[i][j]);

答案:

(1)scanf("

%f"

&

a[i][j]);

(2)a[i][j]/=t;

#include<

stdlib.h>

math.h>

main()

{inti,j,k;

for(i=0;

i<

=2;

i++)

/************found************/

j<

=5;

for(k=0;

k<

=10;

k++)

/************found************/

{if(i*5+j*2+k*1=10)

%d,%d,%d\n"

i,j,k);

(1)for(j=0;

j++)

(2){if(i*5+j*2+k*1==10)

#include<

string.h>

charstr[256];

inti,k=0,n;

gets(str);

n=strlen(str);

n;

/************found************/

if(str[i]>

=0&

&

str[i]<

=9)

{str[k]=str[i];

n++;

str[k]='

\0'

;

printf("

%s\n"

str);

(1)if(str[i]>

=’0’&

=’9’)

(2)k++;

voidfun(char*s,char*t)

inti,s1=strlen(s);

s1;

t[i]=s[i];

t[s1+i]=t[s1-i-1];

t[s1+i]="

\0"

charstr1[40],str2[80];

%c"

str1[40]);

fun(str1,str2);

puts(str2);

(1)t[s1+i]=’\0’;

(2)gets(str1);

或者scanf("

%s"

str1);

{inti,j,t;

for(i=1;

=500;

{t=0;

for(j=1;

if(i%j==0)t+=j;

if(t==i)

{printf("

\n%disafullnumber\n"

i);

factorsof%dare:

\t"

j;

i++)

if(i%j==0)printf("

%d,"

j);

(1)for(j=1;

i;

(2)for(j=1;

{inta[3][3],i,j,max;

3;

a[3][3]);

Themaxis:

"

for(j=0;

max=a[0][0];

for(i=0;

if(max<

a[i][j])max=a[i][j];

%3d"

max);

(2)max=a[0][j];

{intscore,t;

Pleaseenterascore:

/*************found**************/

score);

while(score<

0||score>

100);

t=score/10;

switch(t)

{case10:

case9:

Excellent!

break;

case8:

Good!

case7:

Middle!

case6:

Pass!

defaut:

Fail!

\n);

答案:

(1)scanf("

(2)default:

\n”);

{inta[10]={16,1,2,7,3,12,15,34,5,11},i,s;

s=0;

10;

if(i%2==1)

s=s+a[i];

print("

Theresultis:

%.2f\n"

s);

(1)if(a[i]%2==1)

(2)printf("

%d\n"

#include"

stdio.h"

intx,max,min,i;

=9;

x);

if(i=1){max=x;

min=x;

if(x>

max)max=x;

max)min=x;

max=%d,min=%d\n"

max,min);

(1)if(i==1){max=x;

(2)if(min>

x)min=x;

程序填空题:

intn,m=0,s,c;

scanf("

while(m<

20)

s=n;

c=0;

while(s!

=0)

c=c+s%10;

s=s/10;

/**************found************/

___

(1)___

{m++;

%5d"

n);

___

(2)___

(1)if(c==5);

(2)n++;

{inti,j;

=5-i;

____

(1)____

=i;

'

A'

+j-1);

for(j=i-1;

j>

=1;

j--)

____

(2)____

(1)printf(“”);

{inti,j,p,x[][4]={1,5,7,4,2,6,4,3,8,2,3,1};

{

___

(1)___

if(___

(2)___)

p=j;

Theminvalueinline%dis%d\n"

i,x[i][p]);

(1)p=0;

(2)x[i][p]>

x[i][j]

intn,p,a;

inputn:

/**********found*********/

___

(1)___

while(n!

a=___

(2)___;

if(a%2!

=0)p+=a;

n=n/10;

p);

(2)n%10;

inti,j;

charch;

=4;

putchar('

'

/**************found************/

___

(1)___;

for(j=9-2*i;

0;

___

(2)___);

\n'

(1)ch=’b’;

(2)ch++

main()

inti,a[10],t;

/**************found************/

___

(2)___

t=a[i];

a[i]=a[9-i];

a[9-i]=t;

a[i]);

(1)scanf(“%d”,&

a[i]);

(2)for(i=0;

5;

conio.h>

intprinum(intb[10])

{ints,i,j,k;

k=b[i]-1;

for(j=2;

=k;

if(____

(1)____)

break;

if(j<

=k)

returns;

{inta[]={2,3,4,5,6,7,9,10,11,13},n;

n=prinum(a);

非素数之积为:

%d\n"

n);

(1)b[i]%j==0

(2)s=s+b[i];

inta,b,t,k;

Pleaseentertwonumbers:

a,&

b);

if(a<

b)

{t=a;

a=b;

b=t;

k=a%b;

while(____

(1)____)

{a=b;

b=k;

GCDis:

b);

(1)k

(2)k=a%b;

{inti,p=0,a[10];

___

(1)___;

p=i;

%d,%d\n"

a[p],p);

(1)i<

10

(2)a[p]>

a[i]

程序设计题:

voidnono(ints);

intfun(inta[3][3])

inti,j,s;

/***********begin***********/

/************end************/

{inta[3][3]={1,2,3,4,9,5,7,8,6};

inti,j,s=0;

arrayis:

s=fun(a);

Resultis:

s);

nono(s);

voidnono(ints)

{FILE*f;

f=fopen("

out1.dat"

"

w"

fprintf(f,"

Resultis:

fclose(f);

s=0;

3;

for(j=0;

j<

{

if(i==j)s=s+a[i][j];

elseif(i+j==2)s=s+a[i][j];

}

#include"

math.h"

conio.h"

stdlib.h"

voidNONO(doublex);

{doubles;

inti,n;

s=%f\n"

NONO(s);

voidNONO(doublex)

{FILE*f;

x);

for(i=1;

=n;

s=s+1.0/(i*i);

voidNONO(intmax);

{inta,b,c,max;

max=%d\n"

max);

NONO(max);

voidNONO(intmax)

%d,%d,%d"

a,&

b,&

c);

if(a>

b)max=a;

elsemax=b;

if(max<

c)max=c;

voidnono(floats);

floata,b,c,area,x;

/***********begin***********/

/************end************/

nono(area);

voidnono(floats)

%.2f\n"

area=0;

%f,%f,%f"

x=(a+b+c)/2;

if(a+b>

c)

if(a+c>

b)

if(b+c>

a)area=sqrt(x*(x-a)*(x-b)*(x-c));

if(area)printf("

%.2f"

area);

elseprintf("

No"

voidNONO(longs);

voidmain()

intn,i,j;

longp,s;

intf=1;

s=%ld\n"

voidNONO(longs)

FILE*wf;

wf=fopen("

);

fprintf(wf,"

s);

fclose(wf);

p=1;

=2*n-1;

i=i+2)

for(j=1;

=i;

p=p*j;

s=s+f*p;

p=1;

f=-f;

voidNONO(intcount);

{i

展开阅读全文
相关资源
猜你喜欢
相关搜索
资源标签

当前位置:首页 > 总结汇报 > 学习总结

copyright@ 2008-2023 冰点文库 网站版权所有

经营许可证编号:鄂ICP备19020893号-2