Commit cb596948 by viakul

Upload New File

parent e82689c3
Showing with 56 additions and 0 deletions
#include <stdio.h>
#include <string.h>
int main()
{
char mails[10][100]={"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 names[10][100];
char ending[10][100];
int j;
int i;
int BefAft;
int a;
for(i=0; i<9;i++)
{
BefAft=1;
a=0;
for(j = 0; j < strlen(mails[i]);j++){
if (mails[i][j]=='@')
{
BefAft=0;
names[i][j]='\0';
}
if(BefAft==1){
names[i][j]= mails[i][j];
}else{
ending[i][a]=mails[i][j];
a++;
}
}
ending[i][a+1]='\0';
printf("the name %s\n", names[i]);
printf("domanin %s\n", ending[i]);
printf("\n");
}
printf("the gmail adress. \n");
for(i=0;i<9;i++){
if (0==strcmp(ending[i], "@gmail.com")){
printf("%s\n", names[i]);
}
}
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