HUST Online Judge WebBoard
MainBoard >> lcx
241040500610 @ 2024-11-09 10:19:37
[ Quote ] [ Edit ] [ Delete ] 1#
#include <stdio.h>
#include <stdlib.h>

int main()
{
int a,b,c,d,e,s,v;
scanf("%d\n%d\n%d\n%d\n%d",&a,&b,&c,&d,&e);
s=2*(a*c+a*b+b*c)+8*d*((c-2*e)+(a-2*e)+(b-2*e));
v=a*b*c-2*d*((a-2*e)*(c-2*e)+(b-2*e)*(c-2*e)+(a-2*e)*(b-2*e));
printf("%d %d",s,v);
return 0;
}
241040500610 @ 2024-11-09 11:46:05
[ Quote ] [ Edit ] [ Delete ] 2#
#include <stdio.h>
#include <stdlib.h>
#include <math.h>


int main()

{

char op;
double x,y;
scanf("%lf %c %lf",&x,&op,&y);
switch(op)
{
case '+':
printf("%.2lf",x+y);break;
case '-':
printf("%.2lf",x-y);break;
case '*':
printf("%.2lf",x*y);break;
case '/':
if(fabs(y)>1e-10)
printf("%.2lf",x/y);
else
printf("Wrong input");
break;
default:
printf("Wrong input");

}

return 0;

}