//Created by: Noor Hannani Syamimi and Thuvaaritha
//Program: 

//Program library
#include <iostream>
#include <cctype>
#include <cstring>
using namespace std;

//main function
int main()
{
	//variable
	int stringlength, num, j;
	char string[100];
	char choice;
        
        //ask the user to enter the input (number of repetition)
	    cout << "How many string would you like to enter? ";
	    cin >> num;
	    
	    // outer loop: to repeat the process according to user input (num)
	    for(j = 0; j < num; j++)
	    {
	    	// ask the user to enter the string
			cout << "Enter a string: ";
	    	cin >> string;
	    	
	    	//get the string length
	    	stringlength = strlen(string);
	    	
	    	// inner loop: to repeat the process in determine the palindrome
	    	for (int i = 0; i < stringlength; i++)
	    	{
	    		//to determine wether the string is a palindrome or otherwise
	    		if (string [i] == string[stringlength - i - 1])
	    		{
	    			cout << string << " is a palindrome." << endl;
	    			break; // to break the cycle once it determine the palindrome
				}
				
				else
				{
					cout << string << " is NOT a palindrome." << endl;
					break; // to break the cycle once it determine the palindrome
				}
			}
		}
	
	cout << "\nEnd." << endl;	
	cout << "Thank you for using the test";	
    
	return 0;
}
