选择语句举例Word格式.docx

上传人:b****3 文档编号:7494849 上传时间:2023-05-08 格式:DOCX 页数:15 大小:15.40KB
下载 相关 举报
选择语句举例Word格式.docx_第1页
第1页 / 共15页
选择语句举例Word格式.docx_第2页
第2页 / 共15页
选择语句举例Word格式.docx_第3页
第3页 / 共15页
选择语句举例Word格式.docx_第4页
第4页 / 共15页
选择语句举例Word格式.docx_第5页
第5页 / 共15页
选择语句举例Word格式.docx_第6页
第6页 / 共15页
选择语句举例Word格式.docx_第7页
第7页 / 共15页
选择语句举例Word格式.docx_第8页
第8页 / 共15页
选择语句举例Word格式.docx_第9页
第9页 / 共15页
选择语句举例Word格式.docx_第10页
第10页 / 共15页
选择语句举例Word格式.docx_第11页
第11页 / 共15页
选择语句举例Word格式.docx_第12页
第12页 / 共15页
选择语句举例Word格式.docx_第13页
第13页 / 共15页
选择语句举例Word格式.docx_第14页
第14页 / 共15页
选择语句举例Word格式.docx_第15页
第15页 / 共15页
亲,该文档总共15页,全部预览完了,如果喜欢就下载吧!
下载资源
资源描述

选择语句举例Word格式.docx

《选择语句举例Word格式.docx》由会员分享,可在线阅读,更多相关《选择语句举例Word格式.docx(15页珍藏版)》请在冰点文库上搜索。

选择语句举例Word格式.docx

c&

&

b+c>

a&

c+a>

b)

{

}

if(!

(a+b>

b))

Itisnotatrilateral\n"

);

else

(a+b>

b)?

s=1.0/2*(a+b+c),

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

a,b,c,s),

area)

):

floatx,y;

%f"

x);

if(x>

=5)y=5*x+3;

elsey=4-x;

%f\n"

y);

if(x<

5)y=4-x;

floatx,y,z;

x,&

y,&

z);

=y&

x>

=z)

max=%f\n"

x);

if(y>

=x&

y>

if(z>

z>

=y)

z);

((x>

=y?

x:

y))>

=z?

(x>

y):

voidmain(void)

charc;

Inputacharacter:

"

c=getchar();

if(c<

32)

Thisisacontrolcharacter\n"

if(c>

='

0'

c<

9'

Thisisadigit\n"

else

A'

Z'

Thisisacapitalletter\n"

a'

z'

Thisisasmallletter\n"

Thisisanothercharacter\n"

=5)

y=5*x+3;

1)

y=4-x;

y=6*x*x;

c)

if(b+c>

a)

if(c+a>

b+c<

=aerror!

\n"

else

a+c<

=berror!

a+b<

=cerror!

floata,b,c,p,real,imag,x1,x2;

if(a==0&

b!

=0)

singleroot:

-c/b);

elseif(a!

p=b*b-4*a*c;

real=-b/(2*a);

imag=sqrt(fabs(p))/(2*a);

if(p==0)

twosamerootsis%f"

real);

elseif(p<

0)

noroots\n"

x1=real+imag;

x2=real-imag;

tworealroots:

%10fand%10f\n"

x1,x2);

itisillegal!

singlerootis%f"

complexroots:

%f+%fi\n"

real,imag);

%f-%fi\n"

itisillegalornomeaning\n"

#include"

stdio.h"

main()

{intn;

scanf("

%d"

n);

switch(n)

{case0:

Sunday\n"

case1:

Monday\n"

case2:

Tuesday\n"

case3:

Wednesday\n"

case4:

Thursday\n"

case5:

Friday\n"

case6:

Saturday\n"

default:

inputerror!

}}

{charc;

pleaseinputazifu:

%c"

switch(c)

case'

:

1'

2'

3'

4'

5'

6'

7'

8'

Itisadigit.\n"

break;

'

\n'

\t'

Itisawhite.\n"

Itisachar.\n"

inty,m,d;

pleaseinputyearandmonth:

%d%d"

m);

switch(m)

case7:

case8:

case10:

case12:

d=31;

case9:

case11:

if((y%4==0&

y100!

=0)||(y%400==0))

{d=29;

{d=28;

year:

%dmonth:

%dday=%d\n"

y,m,d);

if(n<

0||n>

100)

printf("

erorr\n"

else

switch(n/10)

case0:

E\n"

break;

D\n"

C\n"

B\n"

A\n"

pleasetypeyourexpression:

%f%c%f"

c,&

y);

+'

%f+%f=%f\n"

x,y,x+y);

-'

%f-%f=%f\n"

x,y,x-y);

*'

%f*%f=%f\n"

x,y,x*y);

/'

if(y==0)

dicisionbyzero!

%f/%f=%f\n"

x,y,x/y);

unknownoperator.\n"

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

当前位置:首页 > IT计算机 > 电脑基础知识

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

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