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