/**************************************************
Write a program that reads a list of banned words
from a file, stores them in an array, and then
simply reads words from the user and returns
"banned" or "not banned" until the word "end" is
encountered. The file starts with a number, which
is the number of banned words, and then the words
themselves are listed.
**************************************************/#include <iostream>#include <fstream>#include <string>usingnamespacestd;intmain(){// Get name of banned-words filestringfile;cout<<"Enter name of input file: ";cin>>file;// Create input file streamifstreamFIN(file.c_str());if(!FIN){cout<<"File not found!"<<endl;return1;}// Read number of words & allocate array!intN;FIN>>N;string*A=newstring[N];// Read words from file into arrayfor(inti=0;i<N;i++)FIN>>A[i];// Get words from userstrings;cout<<"Enter list of words terminated by \"end\""<<endl;for(cin>>s;s!="end";cin>>s){// Look for s in banned listboolfound=false;for(intj=0;j<N;j++)if(s==A[j])found=true;// Print resultsif(found)cout<<"Banned!"<<endl;elsecout<<"Not Banned!"<<endl;}return0;}