00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084 #include <stdio.h>
00085 #include <string.h>
00086
00087 char palindrome[8000] =
00088 "amanaplanacaretabanamyriadasumalacaliarahoopapintacatalpaagasanoil"
00089 "abirdayellavatacawapaxawagataxanayaramacapayamagayatsarawalla"
00090 "caralugerawardabinawomanavassalawolfatunaanitapallafretawattabaya"
00091 "daubatanacabadatumagallahatafagazapasayajawalayawetagallopatuga"
00092 "trotatrapatramatorracaperatopatonkatollaballafairasaxaminimatenora"
00093 "bassapasseracapitalarutanamenatedacabalatangasunanassamawasaga"
00094 "jamadamasubasaltanaxonasailanadawadiaradianaroomaroodaripatada"
00095 "pariaharevelareelareedapoolaplugapinapeekaparabolaadogapatacudanua"
00096 "fanapalarumanodanetaalaganeelabatikamugamotanapamaximamooda"
00097 "leekagrubagobageladrabacitadelatotalacedaratapagagaratamanorabara"
00098 "galacolaapapayawatabarajagabanagapaganabagajarabatawayapapaa"
00099 "localagarabaronamataragagapataradecalatotaledaticabardalegaboga"
00100 "burgakeeladoomamixamapanatomagumakitabaleenagalaatenadonamurala"
00101 "panafaunaducatapagodaalobarapakeepanipagulpaloopadeeraleeralevera"
00102 "hairapadatapiradooramooranaidaraidawadanaliasanoxanatlasabusamadam"
00103 "ajagasawamassananusagnatalabacadetanemanaturalatipacaressapassa"
00104 "baronetaminimaxasariafallaballotaknotapotarepacarrotamartapartatorta"
00105 "gutapollagatewayalawajayasapazagafatahallagamutadabacanatabuaday"
00106 "abattawaterfallapatinaanutaflowalassavanamowanibadrawaregularacalla"
00107 "warastayagamayapacamarayanaxatagawaxapawacatavalleyadribaliona"
00108 "sagaaplatacatnipapooharailacalamusadairymanabateracanalpanama"
00109 "amanaplanacaretabanamyriadasumalacaliarahoopapintacatalpaagasanoil"
00110 "abirdayellavatacawapaxawagataxanayaramacapayamagayatsarawalla"
00111 "caralugerawardabinawomanavassalawolfatunaanitapallafretawattabaya"
00112 "daubatanacabadatumagallahatafagazapasayajawalayawetagallopatuga"
00113 "trotatrapatramatorracaperatopatonkatollaballafairasaxaminimatenora"
00114 "bassapasseracapitalarutanamenatedacabalatangasunanassamawasaga"
00115 "jamadamasubasaltanaxonasailanadawadiaradianaroomaroodaripatada"
00116 "pariaharevelareelareedapoolaplugapinapeekaparabolaadogapatacudanua"
00117 "fanapalarumanodanetaalaganeelabatikamugamotanapamaximamooda"
00118 "leekagrubagobageladrabacitadelatotalacedaratapagagaratamanorabara"
00119 "galacolaapapayawatabarajagabanagapaganabagajarabatawayapapaa"
00120 "localagarabaronamataragagapataradecalatotaledaticabardalegaboga"
00121 "burgakeeladoomamixamapanatomagumakitabaleenagalaatenadonamurala"
00122 "panafaunaducatapagodaalobarapakeepanipagulpaloopadeeraleeralevera"
00123 "hairapadatapiradooramooranaidaraidawadanaliasanoxanatlasabusamadam"
00124 "ajagasawamassananusagnatalabacadetanemanaturalatipacaressapassa"
00125 "baronetaminimaxasariafallaballotaknotapotarepacarrotamartapartatorta"
00126 "gutapollagatewayalawajayasapazagafatahallagamutadabacanatabuaday"
00127 "abattawaterfallapatinaanutaflowalassavanamowanibadrawaregularacalla"
00128 "warastayagamayapacamarayanaxatagawaxapawacatavalleyadribaliona"
00129 "sagaaplatacatnipapooharailacalamusadairymanabateracanalpanama"
00130 "amanaplanacaretabanamyriadasumalacaliarahoopapintacatalpaagasanoil"
00131 "abirdayellavatacawapaxawagataxanayaramacapayamagayatsarawalla"
00132 "caralugerawardabinawomanavassalawolfatunaanitapallafretawattabaya"
00133 "daubatanacabadatumagallahatafagazapasayajawalayawetagallopatuga"
00134 "trotatrapatramatorracaperatopatonkatollaballafairasaxaminimatenora"
00135 "bassapasseracapitalarutanamenatedacabalatangasunanassamawasaga"
00136 "jamadamasubasaltanaxonasailanadawadiaradianaroomaroodaripatada"
00137 "pariaharevelareelareedapoolaplugapinapeekaparabolaadogapatacudanua"
00138 "fanapalarumanodanetaalaganeelabatikamugamotanapamaximamooda"
00139 "leekagrubagobageladrabacitadelatotalacedaratapagagaratamanorabara"
00140 "galacolaapapayawatabarajagabanagapaganabagajarabatawayapapaa"
00141 "localagarabaronamataragagapataradecalatotaledaticabardalegaboga"
00142 "burgakeeladoomamixamapanatomagumakitabaleenagalaatenadonamurala"
00143 "panafaunaducatapagodaalobarapakeepanipagulpaloopadeeraleeralevera"
00144 "hairapadatapiradooramooranaidaraidawadanaliasanoxanatlasabusamadam"
00145 "ajagasawamassananusagnatalabacadetanemanaturalatipacaressapassa"
00146 "baronetaminimaxasariafallaballotaknotapotarepacarrotamartapartatorta"
00147 "gutapollagatewayalawajayasapazagafatahallagamutadabacanatabuaday"
00148 "abattawaterfallapatinaanutaflowalassavanamowanibadrawaregularacalla"
00149 "warastayagamayapacamarayanaxatagawaxapawacatavalleyadribaliona"
00150 "sagaaplatacatnipapooharailacalamusadairymanabateracanalpanama"
00151 "amanaplanacaretabanamyriadasumalacaliarahoopapintacatalpaagasanoil"
00152 "abirdayellavatacawapaxawagataxanayaramacapayamagayatsarawalla"
00153 "caralugerawardabinawomanavassalawolfatunaanitapallafretawattabaya"
00154 "daubatanacabadatumagallahatafagazapasayajawalayawetagallopatuga"
00155 "trotatrapatramatorracaperatopatonkatollaballafairasaxaminimatenora"
00156 "bassapasseracapitalarutanamenatedacabalatangasunanassamawasaga"
00157 "jamadamasubasaltanaxonasailanadawadiaradianaroomaroodaripatada"
00158 "pariaharevelareelareedapoolaplugapinapeekaparabolaadogapatacudanua"
00159 "fanapalarumanodanetaalaganeelabatikamugamotanapamaximamooda"
00160 "leekagrubagobageladrabacitadelatotalacedaratapagagaratamanorabara"
00161 "galacolaapapayawatabarajagabanagapaganabagajarabatawayapapaa"
00162 "localagarabaronamataragagapataradecalatotaledaticabardalegaboga"
00163 "burgakeeladoomamixamapanatomagumakitabaleenagalaatenadonamurala"
00164 "panafaunaducatapagodaalobarapakeepanipagulpaloopadeeraleeralevera"
00165 "hairapadatapiradooramooranaidaraidawadanaliasanoxanatlasabusamadam"
00166 "ajagasawamassananusagnatalabacadetanemanaturalatipacaressapassa"
00167 "baronetaminimaxasariafallaballotaknotapotarepacarrotamartapartatorta"
00168 "gutapollagatewayalawajayasapazagafatahallagamutadabacanatabuaday"
00169 "abattawaterfallapatinaanutaflowalassavanamowanibadrawaregularacalla"
00170 "warastayagamayapacamarayanaxatagawaxapawacatavalleyadribaliona"
00171 "sagaaplatacatnipapooharailacalamusadairymanabateracanalpanama";
00172
00173 int
00174 main()
00175 {
00176 char *start, *end;
00177
00178 printf("Welcome to the palindrome tester!\n");
00179 printf("I will take a large palindrome and test it.\n");
00180 printf("Here it is:\n");
00181 printf("%s\n", palindrome);
00182
00183 printf("Testing...");
00184
00185 end = palindrome+strlen(palindrome);
00186 end--;
00187
00188 for (start = palindrome; start <= end; start++, end--) {
00189 putchar('.');
00190 if (*start != *end) {
00191 printf("NOT a palindrome\n");
00192 return 0;
00193 }
00194 }
00195
00196 printf("IS a palindrome\n");
00197 return 0;
00198 }