Untitled
unknown
plain_text
3 years ago
602 B
6
Indexable
// 18 MEI
#include <stdio.h>
int main()
{
double input, output;
double re_int = 0, re_float = 0;
int INT, digit = 0;
double FLOAT;
scanf("%lf", &input);
INT = (int)input;
FLOAT = input - INT;
while (INT > 0) {
re_int = re_int * 10 + (INT % 10);
INT /= 10;
digit++;
}
while (digit < 6) {
FLOAT *= 10;
re_float = (re_float + (int)FLOAT) * 0.1;
FLOAT = FLOAT - (int)FLOAT;
digit++;
}
output = input + re_int + re_float;
printf("%.3lf\n", output);
return 0;
}Editor is loading...