OJ字串的倒序輸出

2021-06-28 03:14:22 字數 471 閱讀 8088

將乙個字串str的內容顛倒過來,並輸出。str的長度不超過100個字元。

輸入包括一行。第一行輸入的字串。

輸出轉換好的逆序字串。

i am a student

tneduts a ma i

description

將乙個字串str的內容顛倒過來,並輸出。str的長度不超過100個字元。

input

輸入包括一行。第一行輸入的字串。

output

輸出轉換好的逆序字串。

sample input

i am a student

sample output

tneduts a ma i

#include#includeusing namespace std;

int main()

for(i=i-1;i>=0;i--)

cout<

字串倒序輸出

題目 輸入乙個字串,將該串倒序輸出。例如輸入字串 hello 倒序輸出為 olleh str1 str input 請輸入字串 print 輸入的字元是 s str1 str2 定義乙個空串用來接收倒序後的字串 for i in str1 1 對字串進行倒序輸出 str2 join i 使用str2...

倒序輸出字串

public static void main string args system.out.println result public static string revertstring string str char chars str.tochararray int len chars.le...

C 字串的倒序輸出

介紹 在本文中,我將演示如何將字串的單詞倒序輸出。在這裡我不是要將 john 這樣的字串倒序為成 nhoj 這是不一樣的,因為它完全倒序了整個字串。而以下 將教你如何將 你 好 我是 緹娜 倒序輸出為 緹娜 是 我 好 你 所以,字串的最後乙個詞成了第乙個詞,而第乙個詞成了最後乙個詞。當然你也可以說...