一二三区免费观看|av无码字幕av|亚洲AV综合色区无码一区|五月激情网婷婷激情|久久久久久久久久久久久大色天下|国产97av在线|四虎一区在线观看|96人人操_人人|九九九日本精品免费观看|伊人久久激情

揚智科技軟件筆試題目第10題答案

時間:2020-11-16 16:55:24 筆試題目 我要投稿

揚智(科技)軟件筆試題目第10題答案

第10題為:
10.Write a recursive function that tests wether a string is a palindrome.
A palindrome is s string such as "abcba" or "otto" that reads the same in
both directions.If you can write this function recursively,you can write
an iterative version of this function instead.

揚智(科技)軟件筆試題目第10題答案

#include
#include
int count=0;//記錄遞歸函數(shù)中字符串縮短的總次數(shù),可以不要這個。
recp(char s[])//回文的.遞歸函數(shù)
{
int i;
if(strlen(s)==1)//長度為1
return 1;
else if(strlen(s)==2)長度為2的情況
{
if(s[0]==s[1])
return 1;
else
return 0;
}
else if(s[0]==s[strlen(s)-1])
{
count++;
cout<<"The "< char t[]="abcdeabcd";
int svalue,tvalue;
svalue=recp(s);
tvalue=recp(t);
cout<<"the value of string s is:"< cout<<"the value of string t is:"<}
在Visual C++6.0中通過。
 

 

【揚智(科技)軟件筆試題目第10題答案】相關(guān)文章:

英智興達軟件測試筆試題目11-20

楓葉軟件筆試題目與答案11-19

軟件測試筆試題目及答案09-18

軟件測試筆試題目(含答案)11-20

精選軟件測試筆試題目及答案06-23

AutoCAD筆試題目真題和答案12-08

深圳嘉訊軟件科技有限公司筆試題目11-14

軟件測試常見筆試題目07-31

傲盾軟件筆試題目11-19

面試筆試題目規(guī)律題及答案08-03