33 lines
366 B
C
33 lines
366 B
C
#include <cs50.h>
|
|
#include <stdio.h>
|
|
#include <string.h>
|
|
int main (void)
|
|
|
|
{
|
|
string strings [] = {"battleship", "boot", "cannon", "iron", "thimble", "top hat"};
|
|
|
|
string s = get_string("Strings: ");
|
|
for (int i = 0; i < 6; i++)
|
|
{
|
|
if (strcmp(strings [i], == s) == 0)
|
|
{
|
|
printf("Found\n");
|
|
return 0;
|
|
}
|
|
}
|
|
printf("Not found \n");
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|