Guest User

Untitled

a guest
Oct 24th, 2019
240
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.22 KB | None | 0 0
  1. #include <iostream>
  2. #include<fstream>
  3. #include <cctype>
  4. #include <cstdlib>
  5.  
  6. using namespace std;
  7.  
  8. bool czy_taka_sama (string wyraz, int dl)
  9.  
  10. {
  11. for (int i=0; i<=dl/2; i++)
  12. for (int j=dl-1; j>=dl/2; j--)
  13. {
  14. if (wyraz [i] == wyraz [j])
  15. return true;
  16. else
  17. return false;
  18. }
  19. }
  20.  
  21.  
  22. bool sprawdz_czy_mala_litera(string wyraz, int dl)
  23. {
  24. for (int i=0; i<dl; i++)
  25. {
  26. if (islower(wyraz[i]))
  27. return true;
  28. else
  29. return false;
  30. }
  31. }
  32.  
  33. int main()
  34. {
  35.  
  36. int n, dl;
  37. string wyraz="";
  38.  
  39.  
  40. cin>>n;
  41.  
  42. if (n<10000)
  43. {
  44. for (int i=0; i<n; i++)
  45. {
  46.  
  47. while (getline(cin, wyraz))
  48. {
  49.  
  50. dl=wyraz.length();
  51.  
  52. if (sprawdz_czy_mala_litera(wyraz,dl)==true && dl<100)
  53. {
  54. if (czy_taka_sama(wyraz,dl)==true)
  55. cout << "tak" << endl;
  56.  
  57. else
  58. cout << "nie" << endl;
  59. }
  60.  
  61. else
  62. continue;
  63. }
  64. }
  65. }
  66. else
  67. exit(0);
  68.  
  69.  
  70. return 0;
  71. }
Advertisement
Add Comment
Please, Sign In to add comment