四:
1:
#include"stdio.h"
int main()
{
printf("Merry Christmas!\n Happy New Year!");
return 0;
}
2:
#include"stdio.h"
int main()
{
int a;
int x;
printf("Please input:\n");
scanf("%d",&a);
x=a*a;
printf("x=%d\n",x);
return 0;
}
3:
#include"stdio.h"
double min(double x,double y)
{
double m;
if(x>y)
m=y;
else
m=x;
return m;
}
int main()
{
double x,y,t;
printf("Please Input:\n");
scanf("%lf",&x);
printf("Please Input:\n");
scanf("%lf",&y);
t=min(x,y);
printf("min=%f\n",t);
return 0;
}
4:
#include"stdio.h"
int main()
{
double a,b,x;
printf("Please Input:\n");
scanf("%lf",&a);
printf("Please Input:\n");
scanf("%lf",&b);
x=-b/a;
printf("x=%lf",x);
return 0;
}
5:
#include"stdio.h"
#define pi 3.1415926
int main()
{
double radius,height,v;
printf("Please Input Radius:\n");
scanf("%lf",&radius);
printf("Please Input Radius:\n");
scanf("%lf",&height);
v=height*pi*radius*radius;
printf("v=%lf",v);
return 0;
}