Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
viakul
/
iax0583
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
cb596948
authored
Oct 08, 2018
by
viakul
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Upload New File
parent
e82689c3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
56 additions
and
0 deletions
Lab5/namesAndEmails.c
Lab5/namesAndEmails.c
0 → 100644
View file @
cb596948
#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
;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment