#include <stdio.h>
#include <math.h>
int main(){
int a;
printf("Insira um numero de quatro digitos: ");
int digitos_menos_1
= log10(a
); int fator
= pow(10, digitos_menos_1
); int primeiro_digito = a / fator; //a é o numero
printf("%i", primeiro_digito
);
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CiNpbmNsdWRlIDxtYXRoLmg+CgppbnQgbWFpbigpewogICAgaW50IGE7CiAgICBwcmludGYoIkluc2lyYSB1bSBudW1lcm8gZGUgcXVhdHJvIGRpZ2l0b3M6ICIpOwogICAgc2NhbmYoIiVpIiwmYSk7CgogICAgaW50IGRpZ2l0b3NfbWVub3NfMSA9IGxvZzEwKGEpOwogICAgaW50IGZhdG9yID0gcG93KDEwLCBkaWdpdG9zX21lbm9zXzEpOwogICAgaW50IHByaW1laXJvX2RpZ2l0byA9IGEgLyBmYXRvcjsgLy9hIMOpIG8gbnVtZXJvCiAgICBwcmludGYoIiVpIiwgcHJpbWVpcm9fZGlnaXRvKTsKCiAgICByZXR1cm4gMDsKfQo=