游客 Signup | Login
中文 | En

3439 - 字符串长度

输入一个字符串,输出它长度。

Input

有多组测试数据

对于每组数据,每行输入一个字符串,长度不超过20

Output

输出每个字符串长度

Examples

Input

Helloworld
Hello world

Output

10
11

Solution C

#include<stdio.h>
#include<string.h>
void main()
{
	char x[21];
	while((gets(x))!=NULL)
		printf("%d\n",strlen(x));
}

Solution C++

#include <cstdio>
#include <iostream>
#include <cstring>
using namespace std;
int main()
{
	char a[100];
	while(gets(a) != NULL)
	{
		int m = strlen(a);
		cout << m << endl;
	}
}	
	

Time Limit 1 second
Memory Limit 128 MB
Discuss Stats
上一题 下一题