xxxxxxxxxx
#include <stdio.h>
int main()
{
int seconds;
scanf("%d", &seconds);
int hours = seconds / 3600;
seconds = seconds - (hours * 3600);
int minutes = seconds / 60;
seconds = seconds - (minutes * 60);
printf("%d:%d:%d\n", hours, minutes, seconds);
return 0;
}
xxxxxxxxxx
#include<stdio.h>
int main()
{
int X, Y;
float price = 0;
scanf("%d %d", &X, &Y);
if (X == 1)
{
price = (float) (4.00 * Y);
}
else if (X == 2)
{
price = (float) (4.50 * Y);
}
else if (X == 3)
{
price = (float) (5.00 * Y);
}
else if (X == 4)
{
price = (float) (2.00 * Y);
}
else if (X == 5)
{
price = (float) (1.50 * Y);
}
printf("Total: R$ %.2f\n",price);
}
xxxxxxxxxx
#include<stdio.h>
#include<math.h>
int main()
{
double a,b,c,r1,r2,del;
scanf("%lf %lf %lf",&a,&b,&c);
del=(b*b)-(4*a*c);
r1=(-b+sqrt(del))/(2*a);
r2=(-b-sqrt(del))/(2*a);
if(a!=0 && del>0)
{
printf("R1 = %.5lf\nR2 = %.5lf\n",r1,r2);
}
else printf("Impossivel calcular\n");
return 0;
}
xxxxxxxxxx
#include <stdio.h>
#include <math.h>
int main()
{
double x1, x2, y1, y2, dist;
scanf("%lf %lf %lf %lf", &x1, &y1, &x2, &y2);
dist = sqrt(pow(x2-x1,2)+pow(y2-y1,2));
printf("%.4lf\n", dist);
return 0;
}