0?1:0)) == 2?printf("YES\n"):printf("NO\n");
}
11、void main()
{
char a;
scanf("%c",&a);
printf("%c,%c,%c\n",a+1,a,a-1);
printf("%d,%d,%d\n",a+1,a,a-1);
}
12、#include <math.h>
void main()
{
float a,b,c,s,Area;
scanf("%f,%f,%f",&a,&b,&c);
if(a+b>c && a+c>b && b+c>a)
{
s =(a+b+c)/2;
Area = sqrt(s*(s-a)*(s-b)*(s-
c));
printf("%f\n",Area);
}
else
printf("you input the number is
error!\n");
}
第四章
1: 0
2: 20
3
: (x<30&&x>20)||(x<-100)
4:
***a=25,b=14,c=19***
5:
37
6:
if(a<=b) printf("1");
else printf("2");
7、
#include<stdio.h>
void main()
{
char a,b,t1,t2;
scanf("%c,%c",&a,&b);
t1=a>b?a:b;
t2=a<b?a:b;
if((t1-t2)%2==0)printf("%c,
%c",a+1,b+1);
else
printf("%c,%c",a-1,b-1);
getch();
}
8、
#include<stdio.h>
void main()
{
int temp1=0,temp2=0,x,y,i=1;
printf("Please input (x,y): ");
scanf("%d,%d",&x,&y);
while((i*y)<=x)
{
if(x==(i*y)) {temp1=1;break;}
temp2=i;
i++;
}
if(temp1)
printf("%d / %d = %d",x,y,i);
else
printf("%d / %d---> shang=
%d,yushu=%d",x,y,temp2,x-y*temp2);
getch();
}
9、
#include<stdio.h>
void main()
{
float x,y,m=0,n=0;
scanf("%f,%f",&x,&y);
n=(x-2)*(x-2);
m=(y-2)*(y-2);
if((m+n)<=1)
printf("(%.3f,%.3f)In the yuan",x,y);
else
printf("(%.3f,%.3f)out of the yuan",x,y);
getch();
}
10、
#include<stdio.h>
void main()
{
int temp=0,month,year;
printf("Please input (year,month): ");
scanf("%d,%d",&year,&month);
if((year%400==0)||(year%4==0&&year
%100!=0))
temp=1;
if(month==2)