Skip to content

Commit

Permalink
06-12-23
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasz-stepien-dev committed Dec 6, 2023
1 parent a914e37 commit d5575ae
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .idea/PPAD.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 21 additions & 0 deletions 06-12-23/06-12-23-ex1.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#include <iostream>
#include <algorithm>

using namespace std;

int main() {

// Pobieranie ciągu znaków od użytkownika
string input;
cout << "Podaj ciag znakow: ";
cin >> input;

// Odwracanie ciągu znaków
string reversed = input; // Tworzymy kopię oryginalnego ciągu
reverse(reversed.begin(), reversed.end());

// Wyświetlanie odwróconego ciągu
cout << "Odwrocony ciag: " << reversed << endl;

return 0;
}
22 changes: 22 additions & 0 deletions 06-12-23/06-12-23-ex2.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#include <iostream>
#include <algorithm>

using namespace std;

int main() {

string input;
cout << "Podaj ciag znakow: ";
cin >> input;

string reversed = input;
reverse(reversed.begin(), reversed.end());

if (reversed == input) {
cout << "Jest polindromem";
}
else {
cout << "Nie jest polindromem";
}
return 0;
}
16 changes: 16 additions & 0 deletions 06-12-23/06-12-23-ex3.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#include <iostream>
#include <algorithm>

using namespace std;

int main() {

string input;
cout << "Podaj ciag znakow: ";
cin >> input;

input.clear();

cout << input;
return 0;
}

0 comments on commit d5575ae

Please sign in to comment.