#include <stdio.h>
#include <math.h>
int main(void) {
float f1 = 2.1f, f2 = 2.5f, f3 = 2.6f, f4 = 2.9f;
printf("%.1f\n", round(f1));
printf("%.1f\n", round(f2));
printf("%.1f\n", round(f3));
printf("%.1f\n", round(f4));
float f5 = -2.1f, f6 = -2.5f, f7 = -2.6f, f8 = -2.9f;
printf("%.1f\n", round(f5));
printf("%.1f\n", round(f6));
printf("%.1f\n", round(f7));
printf("%.1f\n", round(f8));
return 0;
}
/*
run:
2.0
3.0
3.0
3.0
-2.0
-3.0
-3.0
-3.0
*/