Skip to content

Commit

Permalink
Add ex2
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasz-stepien-dev committed Oct 25, 2023
1 parent 3425616 commit a914e37
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions 25-10-23 Assigments/ex2.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#include <iostream>
#include <string>

int main() {
std::string input;

std::cout << "Podaj ciąg znaków: ";
std::getline(std::cin, input);

std::string modifiedString;
for (char c : input) {
if (c != ' ') {
modifiedString += c;
}
}

std::cout << "bez spacji: " << modifiedString << std::endl;

return 0;
}

0 comments on commit a914e37

Please sign in to comment.