![编写一个函数fun(char str[]),其功能是统计一个字符串中所包含的英文字母的个数?,第1张 编写一个函数fun(char str[]),其功能是统计一个字符串中所包含的英文字母的个数?,第1张](/aiimages/%E7%BC%96%E5%86%99%E4%B8%80%E4%B8%AA%E5%87%BD%E6%95%B0fun%28char+str%5B%5D%29%2C%E5%85%B6%E5%8A%9F%E8%83%BD%E6%98%AF%E7%BB%9F%E8%AE%A1%E4%B8%80%E4%B8%AA%E5%AD%97%E7%AC%A6%E4%B8%B2%E4%B8%AD%E6%89%80%E5%8C%85%E5%90%AB%E7%9A%84%E8%8B%B1%E6%96%87%E5%AD%97%E6%AF%8D%E7%9A%84%E4%B8%AA%E6%95%B0%EF%BC%9F.png)
#include <stdioh>
int fun(char str[])
{
int i,n=0;
for(i=0;str[i];i++)
if(str[i]>='a'&&str[i]<='z'||str[i]>='A'&&str[i]<='Z')
n++;
return n;
}
void main()
{
char k[60];
gets(k);
printf("%d\n", fun(k));
}
#include <stdioh>
int max(int a,int b,int c)
{
int m=a;
if(b>m)m=b;
if(c>m)m=c;
return m;
}
int main()
{
printf("max=%d\n",max(1,2,3));
return 0;
}
#include <stdioh>
#include <stringh>
#include <malloch>
int search(char strSource, char strFind)
{
int find_len=strlen(strFind);
int i=0;
int flag=0;
while( (strSource+i) != '\0' ){
if((strSource+i) == strFind){
if(strncmp(strSource+i,strFind,find_len) ==0){
flag++;
}
}
i++;
}
if(flag!=0){
printf("----找到了[%d]次---\n",flag);
}else{
printf("----没有找到---\n");
}
return 0;
}
int main()
{
char strSource[100] ="three boys have swum across three rivers for three times in three days";
char strFind[10] = "three";
search(strSource,strFind);
return 0;
}
int search( char dstr[][9], int n, char str[] )
{
int i, j;
for( i = 0; i < n; i++ )
{
for( j = 0; j < 9 && dstr[i][j] == str[j]; j++ );
if( j == 9 ) return i;
}
return -1;
}
List list = SearchL;
String s1 = listgetString(listgetSelectedIndex());
int i1 = s1lastIndexOf(':', s1length());
String s4 = s1substring(i1 + 1, s1length());
int j1 = IntegerparseInt(s4, 10);
DrawStrcline = j1;
GuoCPUsetCurrent(BackDis);
DrawStrcline = j1;
} else
if (OpenFun == 2)
{
List list1 = SearchL;
int k = list1getSelectedIndex();
String s2 = list1getString(list1getSelectedIndex());
String s5 = s2substring(0, 3);
Systemoutprintln("285241331= " + s5);
int k1 = IntegerparseInt(s5) - 1;
Systemoutprintln("filej1= " + k1);
Systemoutprintln("搜索文本FilePaths[filej-1]=" + FilePaths[k1]);
GuoCPUExplorerFile(FilePaths[k1]);
}
} else
if (command == CyberSearch)
{
Search_Str = Search_TextFiledgetString();
int j = Search_CHgetSelectedIndex();
if (j == 0)
{
Systemoutprintln("搜索文本");
SearchLdeleteAll();
SearchS(Res_StrS, Search_Str, 0, Res_StrSlength - 1);
} else
if (j == 1)
{
Systemoutprintln("搜索文件");
详情:http://xzf2000ynet/mb/1/ReadNewsaspNewsID=565283
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)