#include <iostream>
using std::cin;
using std::cout;
using std::endl;
int main()
{
int len;
const int MAX_LEN = 20;
char s[MAX_LEN];
char* p;
while ( cin.getline(s, MAX_LEN) )
{
for(p = s; *p != '\0'; p++)
;
cout << p - s << endl;
}
return 0;
}
This is a book.
Thisisabook.