當前位置:編程學習大全網 - 電腦編程 - 如何在編程中找到最多的單詞

如何在編程中找到最多的單詞

# include & ltstdio.h & gt

# include & ltstring.h & gt

void main()

{ char str 1[]= { ' 0 ' };str 2[]= { ' 0 ' };gets(str 1);gets(str 2);//如果是給定的字符串,也就是字符串已經提前初始化,這裏可以省略。)

if(strcmp(str1,str2)>0)

{printf("最大字符串為:");

puts(str 1);}

其他

{printf("最大字符串為:");

看跌期權(str 2);}

if(strlen(str1)>strlen(str2))

{printf("最長的字符串是:");

puts(str 1);}

其他

{printf("最長的字符串是:");

看跌期權(str 2);}

}

  • 上一篇:cortexa系列用什麽軟件編程
  • 下一篇:模具的基準角是如何確定的?
  • copyright 2024編程學習大全網