mirror of
https://github.com/kuhyx/testsAndMisc.git
synced 2026-07-04 19:43:11 +02:00
- Add +x to Python scripts with shebangs (3 files) - Remove -x from non-script files like .cpp, .txt, makefile (23 files) - Move shebang to first line in C/imageViewer/lint.sh
23 lines
538 B
C++
23 lines
538 B
C++
#include <iostream>
|
|
#include <string>
|
|
#include <algorithm>
|
|
|
|
int main()
|
|
{
|
|
std::string userString;
|
|
getline(std::cin, userString);
|
|
int sLength = userString.length();
|
|
std::string tempString = userString;
|
|
for(int i = 0; i < sLength/2; i++)
|
|
{
|
|
char temp = tempString[sLength - 1 - i];
|
|
tempString[sLength - 1 - i] = tempString[i];
|
|
tempString[i] = temp;
|
|
}
|
|
reverse(userString.begin(), userString.end());
|
|
bool correct = tempString == userString;
|
|
std::cout << correct << std::endl;
|
|
std::cout << tempString << std::endl;
|
|
return 0;
|
|
}
|