#include <iostream>
using namespace std;
bool teksty_sa_identyczne(string t1, string t2);
int main()
{
string tekst1 = "Lorem ipsum dolor sit amet.",
tekst2 = "Excepteur sint occaecat non proident.";
cout << "Tekst:\n"
<< "1. " << tekst1 << "\n"
<< "2. " << tekst2 << "\n"
<< "sa " << ((teksty_sa_identyczne(tekst1, tekst2)) ? "identyczne" : "rozne") << "\n\n";
cout << "Tekst:\n"
<< "1. " << tekst1 << "\n"
<< "2. " << tekst1 << "\n"
<< "sa " << ((teksty_sa_identyczne(tekst1, tekst1)) ? "identyczne" : "rozne") << endl;
return 0;
}
bool teksty_sa_identyczne(string t1, string t2)
{
int dl1 = t1.length(),
dl2 = t2.length();
int i = 0;
while (i < dl1 && i < dl2 && t1[i] == t2[i])
i++;
return i == dl1 && i == dl2;
}