Happy About the progress
This commit is contained in:
+32
@@ -0,0 +1,32 @@
|
||||
#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;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user