#include<stdio.h> int main() { float a = 0, sum = 0; scanf("%f", &a); if (a >= 100) { if (a < 500) sum = a * 0.9; else if (a < 2000) sum = a * 0.8; else if (a < 5000) sum = a * 0.7; else sum = a * 0.6; } printf("%.1f", sum); return 0; }
#include<stdio.h> int main() { float a = 0, sum = 0; scanf("%f", &a); if (a >= 100) { if (a < 500) sum = a * 0.9; else if (a < 2000) sum = a * 0.8; else if (a < 5000) sum = a * 0.7; else sum = a * 0.6; } printf("%.1f", sum); return 0; }