#include <iostream>
#include <string>
using namespace std;
int n,i,len;//n数字字符的数量,i, len是长度
char s[256];
int main () {
gets(s); //输入一个字符串
len=strlen(s); //求字符串长度,这行编译不过?
for(int i=0;i<=len-1;i++){//遍历整个字符串
if(s[i]>='0'&&s[i]<=='9')n++;//如果遇到数字字符,n++
}
cout <<n;//输出两个单词换行
return 0; }
#include <string>
using namespace std;
int n,i,len;//n数字字符的数量,i, len是长度
char s[256];
int main () {
gets(s); //输入一个字符串
len=strlen(s); //求字符串长度,这行编译不过?
for(int i=0;i<=len-1;i++){//遍历整个字符串
if(s[i]>='0'&&s[i]<=='9')n++;//如果遇到数字字符,n++
}
cout <<n;//输出两个单词换行
return 0; }