#include <stdio.h>
void main() {
int digits;
scanf("%d", &digits);
if (digits < 9) {
int result = 0;
digits -= 1;
while (digits >= 0) {
int i = 1;
int timer = 2;
while (i < digits) {
timer *= 2;
i++;
}
if (digits == 0)
timer -= 1;
int temp;
scanf("%d", &temp);
result += temp * timer;
digits--;
}
printf("%d", result);
}
}
To embed this project on your website, copy the following code and paste it into your website's HTML: