Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include<fstream>
- #include <cctype>
- #include <cstdlib>
- using namespace std;
- bool czy_taka_sama (string wyraz, int dl)
- {
- for (int i=0; i<=dl/2; i++)
- for (int j=dl-1; j>=dl/2; j--)
- {
- if (wyraz [i] == wyraz [j])
- return true;
- else
- return false;
- }
- }
- bool sprawdz_czy_mala_litera(string wyraz, int dl)
- {
- for (int i=0; i<dl; i++)
- {
- if (islower(wyraz[i]))
- return true;
- else
- return false;
- }
- }
- int main()
- {
- int n, dl;
- string wyraz="";
- cin>>n;
- if (n<10000)
- {
- for (int i=0; i<n; i++)
- {
- while (getline(cin, wyraz))
- {
- dl=wyraz.length();
- if (sprawdz_czy_mala_litera(wyraz,dl)==true && dl<100)
- {
- if (czy_taka_sama(wyraz,dl)==true)
- cout << "tak" << endl;
- else
- cout << "nie" << endl;
- }
- else
- continue;
- }
- }
- }
- else
- exit(0);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment