#include <stdio.h>
#include <stdlib.h>
#include <math.h>
int main()
{
double a,b,c,r1,r2,temp;
scanf("%lf%lf%lf", &a,&b,&c);
temp = pow(b, 2.0) - 4*a*c;
if(a)
{
if(temp < 0)
{
printf("No real roots!");
}
else
{
r1 = (-b + sqrt(temp)) / 2*a;
r2 = (-b - sqrt(temp)) / 2*a;
printf("r1=%7.2f\n", r1);
printf("r2=%7.2f", r2);
}
}
return 0;
}
#include <stdio.h>
#include <stdlib.h>
int main()
{
double num1, num2;
scanf("%lf%lf", &num1, &num2);
if(num1 >= num2)
{
printf("%.2f %.2f\n", num2, num1);
}
else
{
printf("%.2f %.2f\n", num1, num2);
}
return 0;
}
#include <stdio.h>
#include <stdlib.h>
int main()
{
double a,b,c,temp;
scanf("%lf%lf%lf", &a,&b,&c);
if(a>=b)
{
temp = a;
a = b;
b= temp;
}
if(b>=c)
{
temp = b;
b = c;
c = temp;
if(a >= b){
temp = a;
a = b;
b = temp;
}
}
printf("%.2f %.2f %.2f\n", a,b,c);
return 0;
}
#include <stdio.h>
#include <stdlib.h>
int main()
{
int a,b,c,temp;
scanf("%d%d%d", &a, &b, &c);
if(a>=b)
{
temp = a;
}
else
{
temp = b;
}
if(temp >= c)
{
printf("%d", temp);
}
else
{
printf("%d", c);
}
return 0;
}
#include <stdio.h>
#include <stdlib.h>
int main()
{
//profit: 公司利润 bonus: 应得奖金
double profit, bonus;
scanf("%lf", &profit);
if(profit >=0 && profit <= 100000){
bonus = profit * 0.1;
}else if (profit > 100000 && profit <= 200000){
bonus = 100000 * 0.1 + (profit - 100000) * 0.075;
}else if (profit > 200000 && profit <= 400000){
bonus = 100000 * (0.1+ 0.075) + (profit - 200000) * 0.05;
}else if(profit > 400000 && profit <= 600000){
bonus = 100000 * (0.1 + 0.075) + (400000 - 200000)*0.05 + (profit - 400000) * 0.03;
}else if(profit > 600000 && profit <= 1000000){
bonus = 100000 * (0.1 + 0.075) + (400000 - 200000)*0.05+ (600000 - 400000) * 0.03 + (profit - 600000) * 0.015;
}else{
bonus = 100000 * (0.1 + 0.075) + (400000 - 200000)*0.05+ (600000 - 400000) * 0.03 + (1000000 - 600000) * 0.015 + (profit - 600000) * 0.01;
}
printf("%.2f", bonus);
return 0;
}