1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
| #include <stdio.h>
#include <string.h>
#include <ctype.h>
int count (char p[],char pmax[])
{
int j=0,k,m=0;
char temp[100];
while(*p) {
while((!isalpha(*p))&&*p) p++;
k=0;
if(*p!='\0') m++;
while(isalpha(*p))
temp[k++]=*p++;
temp[k]= "\0";
if(k<j) {
j=k;
pmax=temp;
}
}
return m;
}
void main()
{
char a[100]="you are teacher234too.",max[100];
int i;
i=count(a[],max[]);
if(i==0)
printf("a=%s N0 letter string!\n",a);
else
printf("a=%s\nnumber is %d\nmax string:%s\n",a,i,max);
} |
#include <stdio.h>
#include <string.h>
#include <ctype.h>
int count (char p[],char pmax[])
{
int j=0,k,m=0;
char temp[100];
while(*p) {
while((!isalpha(*p))&&*p) p++;
k=0;
if(*p!='\0') m++;
while(isalpha(*p))
temp[k++]=*p++;
temp[k]= "\0";
if(k<j) {
j=k;
pmax=temp;
}
}
return m;
}
void main()
{
char a[100]="you are teacher234too.",max[100];
int i;
i=count(a[],max[]);
if(i==0)
printf("a=%s N0 letter string!\n",a);
else
printf("a=%s\nnumber is %d\nmax string:%s\n",a,i,max);
}