@@ -83,6 +83,7 @@ a canal - Panama!
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <test161/test161.h>
|
||||
|
||||
char palindrome[8000] =
|
||||
"amanaplanacaretabanamyriadasumalacaliarahoopapintacatalpaagasanoil"
|
||||
@@ -175,24 +176,24 @@ main(void)
|
||||
{
|
||||
char *start, *end;
|
||||
|
||||
printf("Welcome to the palindrome tester!\n");
|
||||
printf("I will take a large palindrome and test it.\n");
|
||||
printf("Here it is:\n");
|
||||
printf("%s\n", palindrome);
|
||||
tprintf("Welcome to the palindrome tester!\n");
|
||||
tprintf("I will take a large palindrome and test it.\n");
|
||||
tprintf("Here it is:\n");
|
||||
tprintf("%s\n", palindrome);
|
||||
|
||||
printf("Testing...");
|
||||
tprintf("Testing...");
|
||||
/* skip to end */
|
||||
end = palindrome+strlen(palindrome);
|
||||
end--;
|
||||
|
||||
for (start = palindrome; start <= end; start++, end--) {
|
||||
putchar('.');
|
||||
if (*start != *end) {
|
||||
printf("NOT a palindrome\n");
|
||||
success(TEST161_FAIL, SECRET, "/testbin/palin");
|
||||
tprintf("NOT a palindrome\n");
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
printf("IS a palindrome\n");
|
||||
tprintf("IS a palindrome\n");
|
||||
success(TEST161_SUCCESS, SECRET, "/testbin/palin");
|
||||
return 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user