#include <stdio.h>
#include <string.h>
void hoge(const char *p)
{
int i;
for (i = strlen(p) - 1; 0 <= i; i--) {
if (p[i] == '.') break;
}
printf("%s=%d\n", p, i);
}
int main()
{
hoge("a.c");
hoge("abc");
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CiNpbmNsdWRlIDxzdHJpbmcuaD4KCnZvaWQgaG9nZShjb25zdCBjaGFyICpwKQp7CglpbnQJaTsKCglmb3IgKGkgPSBzdHJsZW4ocCkgLSAxOyAwIDw9IGk7IGktLSkgewoJCWlmIChwW2ldID09ICcuJykgYnJlYWs7Cgl9CglwcmludGYoIiVzPSVkXG4iLCBwLCBpKTsKfQoKaW50IG1haW4oKQp7Cglob2dlKCJhLmMiKTsKCWhvZ2UoImFiYyIpOwoJcmV0dXJuIDA7Cn0K