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