#include<stdio.h>
#include<string.h>
#define n 100
int main(){
int i,j=0,k;
char str[n],temp[n]={0},max[n]={0};
gets(str);
for(i=0;i<=strlen(str);i++){
if(str[i]>='0'&&str[i]<='9'){
temp[j]=str[i];
j++;
}
else {
j=0;
if(strlen(temp)>strlen(max)){
for(k=0;k<=strlen(temp);k++){
max[k]=temp[k];
}
}
}
}
if(max[1]!=0) printf("%s\n",max);
else printf("No\n");
return 0;
}
7-1 查找字符串中最长的数字子串 (100 分)
最新推荐文章于 2022-12-29 14:04:25 发布