教材第四章习题文档格式.docx

上传人:b****5 文档编号:19217180 上传时间:2023-01-04 格式:DOCX 页数:34 大小:439.13KB
下载 相关 举报
教材第四章习题文档格式.docx_第1页
第1页 / 共34页
教材第四章习题文档格式.docx_第2页
第2页 / 共34页
教材第四章习题文档格式.docx_第3页
第3页 / 共34页
教材第四章习题文档格式.docx_第4页
第4页 / 共34页
教材第四章习题文档格式.docx_第5页
第5页 / 共34页
点击查看更多>>
下载资源
资源描述

教材第四章习题文档格式.docx

《教材第四章习题文档格式.docx》由会员分享,可在线阅读,更多相关《教材第四章习题文档格式.docx(34页珍藏版)》请在冰豆网上搜索。

教材第四章习题文档格式.docx

inta;

%d"

if(a>

a<

60)

E"

=60&

70)

D"

=70&

80)

C"

=800&

90)

B"

=90&

=100)

A"

第2种方法:

inta,t;

inputdate:

\n"

t=a/10;

switch(t){

case1:

case2:

case3:

case4:

case5:

printf("

E\n"

break;

case6:

D\n"

case7:

C\n"

case8:

B\n"

case9:

case10:

A\n"

第四题:

doublex,y,z;

%lf%lf"

x,&

y);

y>

=0){

z=pow(x,2)+pow(y,2);

printf("

z=%f"

z);

if(x<

0&

y<

0){

z=pow(x,2)-pow(y,2);

z=x+y;

x=%f"

z=x-y;

第五题:

doublea,b,c,x,y,z,s,area;

%lf%lf%lf"

a,&

b,&

c);

x=a+b-c;

y=a+c-b;

z=c+b-a;

if(x!

y!

z!

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

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

area=%f\n"

area);

error!

第六题:

inputafiger:

switch(a){

星期1"

case2:

星期2"

case3:

星期3"

case4:

星期4"

case5:

星期5"

case6:

星期6"

case7:

星期7"

第七题:

inty,m,d,i,mon=0,sum=0;

inta[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};

inpury-m-d:

%d-%d-%d"

y,&

m,&

d);

if(m<

=0||m>

12||d<

=0||d>

31){

exit(0);

if(y/4==0&

y/100==0||y/400==0)

a[2]=29;

for(i=0;

i<

m;

i++)

mon+=a[i];

sum=mon+d;

sum=%d"

sum);

第八题:

intn,s=1,i,x;

inputn:

n);

inputnfigers:

n;

i++){

scanf("

if(x%2!

s*=x;

}

s=%d"

第九题:

inta,t,sum=0,d;

do{

t=a%10;

sum=sum+t;

d=a;

a=d/10;

}while(a!

=0);

第十题:

intn,a=0,b=0,c=0,i;

doublex;

if(x<

a++;

if(x==0)

b++;

if(x>

c++;

负数个数:

%d\n"

a);

零个数:

b);

正数个数:

c);

第十一题:

intn=10,i;

input10figers:

n-1;

y=y<

x?

y:

x;

thelowfigeris:

%f\n"

第12题:

doublex,mix,max,sum,aver,t;

请输入10个选手的评分:

t);

max=t;

mix=t;

sum=t;

0||t<

"

exit(0);

sum+=x;

mix=mix<

mix:

max=max>

max:

aver=(sum-max-mix)/8;

aver=%f"

aver);

第十三题:

intx=65,n=90,i;

for(i=x;

=90;

%cASCII:

%d\t"

i,i);

第十四题:

inti,x,y,z,t,h;

for(i=100;

1000;

x=pow(i/100,3);

t=i/10;

y=pow(t%10,3);

z=pow(i%10,3);

h=x+y+z;

if(h==i)

i=%d\t"

i);

第十五题:

intn;

doublei,sum=0,t;

for(i=1;

=n;

t=pow((-1),(i+1))/i;

sum+=t;

sum=%f"

第十六题:

inti;

doubleh,c;

for(i=30;

=40;

h=i;

c=5*(h-32)/9;

h=%f\tc=%f\n"

h,c);

第十七题:

doublei,sum=0,a=81;

sum+=a;

a=sqrt(a);

第十八题:

inti,j,t;

10;

for(j=1;

j<

=i;

j++){

t=j*i;

%d*%d=%d\t"

j,i,t);

第十九题:

inta=1,i,s=0;

s=(s+1)*2;

s=%d\n"

第20题:

inti,j,h,n;

inpurn:

for(j=0;

n-i;

j++)

\t"

for(h=0;

h<

2*i-1;

h++){

*"

(第2小题)

(n-i)*2-1;

第21题:

inta,b,i,j,t,z;

inputab:

%d%d"

b);

z=a;

a=a<

b?

a:

b;

b=b>

z?

b:

z;

for(i=a;

=b;

for(j=2,t=2;

i;

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

//只要有一个被i整除,t值就立刻改变,就说明不是素数。

if(t==2)

printf("

第22题:

doublex,mix,max,f;

x=-2;

max=pow(x,2)-3.14*x-6;

mix=pow(x,2)-3.14*x-6;

while(x>

=-2&

=2){

x=x+0.5;

f=pow(x,2)-3.14*x-6;

f?

f;

max=%f,mix=%f"

max,mix);

第23题:

intn=0,f,i,j,t;

for(i=-39;

f=i*i+i+41;

for(j=2,t=1;

if(f%j==0)

t=0;

if(t==1){

(%d,%d)\t"

i,f);

n++;

}

if(n<

notallis\n"

(阳历的)日历

intm,i,j,n=0,y=2010,wo,w,a;

inputtheformof:

year-month:

%d-%d"

m);

//输入格式的决定

if(y%4==0&

y%100!

=0||y%400==0)

a=29;

elsea=28;

//闰年的判断及2月日数的确定

1||m>

12){

monthisnotexit,pleaseinputlater!

wo=(y+(y-1)/4-(y-1)/100+(y-1)/400)%7;

//1月1日的算法wo表示

55;

//*的输入

for(j=1;

=7;

星期%d\t"

j);

//星期的输入

//表前的建造

switch(m){

for(i=1;

wo;

n++;

=31;

if(n%7==0)

break;

//1month

w=(wo+31)%7;

for(i=1;

w;

=a;

//2month

w=(wo+31+a)%7;

//3month

w=(wo+31+a+31)%7;

=30;

//4month

w=(wo+31+a+31+30)%7;

//5month

w=(wo+31+a+31+30+31)%7;

//6month

w=(wo+31+a+31+30+31+30)%7;

//7month

w=(wo+31+a+31+30+31+30+31)%7;

//8month

w=(wo+31+a+31+30+31+30+31+31)%7;

//9month

w=(wo+31+a+31+30+31+30+31+31+30)%7;

//10month

case11:

w=(wo+31+a+31+30+31+30+31+31+30+31)%7;

//11month

case12:

w=(wo+31+a+31+30+31+30+31+31+30+31+30)%7;

//12month

//表尾的处理

pri

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

当前位置:首页 > 初中教育 > 理化生

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1