日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 人工智能 > 循环神经网络 >内容正文

循环神经网络

matlab201a教程,实验6 - 数媒201郭凯妮的个人空间 - OSCHINA - 中文开源技术交流社区...

發(fā)布時間:2023/12/15 循环神经网络 26 豆豆
生活随笔 收集整理的這篇文章主要介紹了 matlab201a教程,实验6 - 数媒201郭凯妮的个人空间 - OSCHINA - 中文开源技术交流社区... 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

1 .編程實現(xiàn):輸入兩個英文名字串,比較兩個串的串長和串的大小,按要求輸出結(jié) 果。(比如,輸入的兩個名字串:Tom 與 Charli,輸出結(jié)果為: 較長的串是 Charli, 較 大的串是:Tom)

#include

#include

#include

#define STR_LEN 80

int main(){

char s1[STR_LEN+1],s2[STR_LEN+1];

printf("first str:");

gets(s1);

printf("second str:");

gets(s2);

if(strlen(s1)>strlen(s2)){

printf("%s is the longer string.\n",s1);

}

else if(strlen(s1)

printf("%s is the longer string.\n",s2);

}

else{

printf("%s and %s are same longer.\n",s1,s2);

}

if(strcmp(s1,s2)<0){

printf("%s is the largest string.\n",s2);

}

else if(strcmp(s1,s2)>0){

printf("%s is the largest string.\n",s1);

}

else{

printf("%s and %s are same largest.\n",s1,s2);

}

system("pause");

return 0;

}

2 .編程實現(xiàn):輸入一個長串 str1(比如“my heart will go on”),再輸入一個短串 str2(比如“ear”),判斷在長串中是否有短串,比輸出結(jié)果(按以上的情況查詢,輸出結(jié) 果是在 str1 中有 str2)

#include

#include

#include

#define STR_LEN1 80

#define STR_LEN2 50

int main(){

char str1[STR_LEN1+1],str2[STR_LEN2+1];

printf("請輸入一個長串:");

gets(str1);

printf("請輸入一個短串:");

gets(str2);

if(strstr(str1,str2)!=NULL){

printf("%s 中沒有 %s.\n",str1,str2);

}

else{

printf("%s 中有 %s.\n",str1,str2);

}

system("pause");

return 0;

}

3

3.編程實現(xiàn):輸入一行英文句子,按空格分出若干個單詞,每一行只輸出一個單詞。

#include

#include

#include

#define STR 80

int main(){

char a[STR+1];

int len;

printf("Enter a sentence:\n");

gets(a);

len=strlen(a);

for(int i=0;i

if(a[i]==' '){

a[i]='\n';

}

}

printf("Output as:\n");

printf("%s\n",a);

system("pause");

return 0;

}

4 .編寫程序:輸入一個字符串,分別統(tǒng)計字符串中大寫字母和小寫字母的個數(shù)。例 如,給字符串 SS 輸入:AaaaBBb123CCccccd,則輸出結(jié)果應為:upper=5,lower=9.

#include

#include

#include

#define STR_LEN 80

int main()

{

char ss[STR_LEN+1];

char c;

int upper=0,low=0;

printf("??????×?ˇ?′?:\n");

gets(ss);

int i=0;

while(ss[i]!='\0'){

if(isupper(ss[i]))

upper++;

if(islower(ss[i]))

low++;

i++;

}

printf("upper=%d,low=%d\n",upper,low);

system("pause");

return 0;

}

總結(jié)

以上是生活随笔為你收集整理的matlab201a教程,实验6 - 数媒201郭凯妮的个人空间 - OSCHINA - 中文开源技术交流社区...的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。