演算法筆記3 6字串處理

2021-08-21 17:59:27 字數 484 閱讀 5547

讀入一串字元,判斷是否是回文串。「回文串」是乙個正讀和反讀都一樣的字串,比如「level」或者「noon」等等就是回文串。

一行字串,長度不超過255。

如果是回文串,輸出「yes」,否則輸出「no」。

12321
yes
**:

#include

#include

#include

#include

class student;

using namespace std;

int f(int n)

else

result=f(n-1)+f(n-2);

return result;

}void reverse1(char s,char s1)

}int main()

if(flag==0)

cout<<"yes"

cout<<"no"

8 8字串處理

字串處理 string 無子類 hello 構造字串物件 public int length 獲取字串的長度 system.out.println 輸入姓名 scanner sc new scanner system.in string str sc.nextline string str 李芳 s...

演算法筆記03 字串01

1.字串的構造 string s0 hello world string s1 s0 s1拷貝s0 string s2 s0,8,3 s2從s0下標第8號開始拷貝3位,s2 rld string s3 hello world s3拷貝字串 string s4 hello world 5 s4拷貝he...

python筆記1 字串處理函式

對於re.findall 第三個引數預設為空 返回值為乙個列表 import re data re.findall r text,re.s 標記乙個子表示式的開始和結束位置,表示除換行符以外的乙個字元,前面內容可以出現0次或多次,前面的內容 子表達 可以出現0次或1次 如果不使用re.s引數,則只在...