Skip to content

Commit

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

int main() {
char firstString[100];
char secondString[100];

std::cout << "Podaj pierwszy ciąg znaków: ";
std::cin.getline(firstString, sizeof(firstString));

std::cout << "Podaj drugi ciąg znaków: ";
std::cin.getline(secondString, sizeof(secondString));

int result = std::strcmp(firstString, secondString);

if (result == 0) {
std::cout << "Ciągi znaków są takie same." << std::endl;
} else {
std::cout << "Ciągi znaków są różne." << std::endl;
}

return 0;
}

0 comments on commit 3425616

Please sign in to comment.