-
-
Save rpt/403136 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <string.h> | |
void printHeader() { | |
printf("Content-Type: text/html; charset=UTF-8\n\n"); | |
printf("<html>\n"); | |
printf("<head>\n"); | |
printf(" <title>Imiona</title>\n"); | |
printf("</head>\n"); | |
printf("<body>\n"); | |
printf(" <ul>\n"); | |
} | |
void printFooter() { | |
printf(" </ul>\n"); | |
printf("</body>\n"); | |
printf("</html>\n"); | |
} | |
int main () { | |
char* imiona[] = {"Ania", "Anna", "Kasia", "Ala", "Tomek", "Krzysiek", "Krzysztof", "Grzegorz", "Julia", "Karolina", "Ola", "Marek", "Piotr", "Tadeusz", "Zenon", "Tytus"}; | |
char* str= "Ala ma kota, Tytus ma Grzegorz"; | |
int i, N; | |
printHeader(); | |
N = sizeof imiona / sizeof (char*); | |
for(i=0; i<N; i++) { | |
if(strstr(str, imiona[i]) != NULL) | |
printf(" <li>%s</li>\n", imiona[i]); | |
} | |
printFooter(); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment