str1: At MIT, pushing the boundaries of knowledge and possibility is our joyful obsession, and we celebrate fundamental discoveries and practical applications alike. As educators, we also value research as a potent form of learning by doing. Through MIT’s Undergraduate Research Opportunities Program (UROP(opens in new window)), more than 85% of undergraduates enrich their education through engaging in frontline, faculty-led research.
反向遍历,加密
.hcraeser del-ytlucaf ,eniltnorf ni gnigagne hguorht noitacude rieht hcirne setaudargrednu fo %58 naht erom ,))wodniw wen ni snepo(PORU( margorP seitinutroppO hcraeseR etaudargrednU s’TIM hguorhT .gniod yb gninrael fo mrof tnetop a sa hcraeser eulav osla ew ,srotacude sA .ekila snoitacilppa lacitcarp dna seirevocsid latnemadnuf etarbelec ew dna ,noissesbo lufyoj ruo si ytilibissop dna egdelwonk fo seiradnuob eht gnihsup ,TIM tA
------------------
(program exited with code: 0)
请按任意键继续. ..
fn main() {
//&str是一个切片(&[u8]),它总是指向一个有效的UTF-8序列,并且可以用来查看String,就像&[T]是Vec的一个视图一样
// 对只读内存中分配的字符串的引用
let str1: &'static str = "At MIT, pushing the boundaries of knowledge and possibility is our joyful obsession, and we celebrate fundamental discoveries and practical applications alike. As educators, we also value research as a potent form of learning by doing. Through MIT’s Undergraduate Research Opportunities Program (UROP(opens in new window)), more than 85% of undergraduates enrich their education through engaging in frontline, faculty-led research.";//"二叉堆是完全二叉树或者是近似完全二叉树。二叉堆满足堆特性:父节点的键值总是保持固定的序关系于任何一个子节点的键值,且每个节点的左子树和右子树都是一个二叉堆";
println!("str1: {}", str1);
// 反向遍历,加密
println!("反向遍历,加密");
let new_str1:Vec<_>=str1.split("").collect();
for w in new_str1.iter().rev(){
print!("{}", w);
}
}