Commit 28a430cd by matjul

Upload New File

parent 9eb72f15
Showing with 46 additions and 0 deletions
#include <string.h>
#include <stdio.h>
int main(){
char list[9][50] = {
{"someguy@rusty.edu"},
{"milfHunter@gmail.com"},
{"smarmy@yahoo.com"},
{"h8sgmail.com@yahoo.com"},
{"smokinRocks@gmail.com"},
{"whodoesthis?@hotmail.com"},
{"smallPerson@hotmail.com"},
{"WhereIntheW0rld@WIW.com"},
{"mom_has_a_computer@aol.com"}
};
char c = '@';
char* listOfGmails[9];
int i;
int number;
char d[11] = "@gmail.com";
for(i = 0; i < 9; i++){
listOfGmails[i] = strstr(list[i], d);
if(listOfGmails[i]){
listOfGmails[i][0] = '\0';
printf("%s\n", list[i]);
number++;
}
}
for(i = 0; i < 9; i++){
listOfGmails[i] = strchr(list[i], c);
if(listOfGmails[i]){
listOfGmails[i][0] = '\0';
printf("%s\n", list[i]);
}
}
printf("%d", number);
return 0;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment