11549 - Easy Palindrome
raw download clone
C
views 19
,
size 372 b
#include <stdio.h>

int main(void)
{
    double n, m, temp;
    int a[7];

    scanf("%lf", &n);
    temp = n;
    for(int i=1; i<=6; i++)
    {
        a[i] = temp / 100;
        temp -= 100 * a[i];
        temp *= 10;
    }
    m = 100 * a[3] + 10 * a[2] + a[1] + 0.1 * a[6] + 0.01 * a[5] + 0.001 * a[4];
    printf("%.3lf", n + m);

    return 0;
}
close fullscreen
Login or Register to edit or fork this paste. It's free.