"C++ 문자열 뒤집기"의 두 판 사이의 차이

(새 문서: ==개요== ;C++ 문자열 뒤집기 <source lang='c'> #include <iostream> #include <bits/stdc++.h> using namespace std; int main() { string s = "hello"; reverse(s.begin(), s...)
 
 
(사용자 2명의 중간 판 5개는 보이지 않습니다)
1번째 줄: 1번째 줄:
==개요==
==개요==
;C++ 문자열 뒤집기
;C++ 문자열 뒤집기
<source lang='c'>
<syntaxhighlight lang='cpp' run>
#include <iostream>
#include <iostream>
#include <bits/stdc++.h>  
#include <algorithm>  
using namespace std;
using namespace std;
int main() {
int main() {
     string s = "hello";  
     string s = "hello";  
     reverse(s.begin(), s.end());  
     reverse(s.begin(), s.end());  
     cout << s;
     cout << s; // olleh
    // olleh
}
}
</source>
</syntaxhighlight>


==같이 보기==
==같이 보기==
* [[C++ 문자열]]
* [[C언어 문자열 뒤집기]]
* [[함수 StringReverse()]]
* [[함수 StringReverse()]]


[[분류: C++ 문자열]]
[[분류: C++ 문자열]]
[[분류: C++ algorithm]]

2023년 9월 10일 (일) 17:06 기준 최신판

1 개요[ | ]

C++ 문자열 뒤집기
#include <iostream>
#include <algorithm> 
using namespace std;
int main() {
    string s = "hello"; 
    reverse(s.begin(), s.end()); 
    cout << s; // olleh
}

2 같이 보기[ | ]

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}