quote:Original post by quant
Nice little problem
Heres my solution, think it works as you need it too
#include<iostream>#include<cstdlib>int main(){ char alpha[]="abcdefghijklmnopqrstuvwxyz"; char input; std::cin>>input; for(int i=0;i<strlen(alpha);++i) { int j=0; for(;j<i;++j) { std::cout<<alpha[j]; } for(;j>=0;--j) { std::cout<<alpha[j]; } std::cout<<"\n"; if(alpha[i]==input)break;}system("pause");return(0);}
Damn, that IS clever. Short and sweet - nice.