Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- #include<string.h>
- int main(){
- int count=0, usersize=0, vcheck;
- char mail[255];
- scanf("%[^\n]", mail);
- char user[15];
- char url[20];
- count = strlen(mail);
- for(int i=0;i<count;i++){
- user[i]=mail[i];
- if(mail[i]=='@'){
- break;
- }
- else{
- usersize++;
- }
- }
- if(usersize<=6){
- }
- else{
- printf("INVALID\n");
- return 0;
- }
- int j=0;
- for(int i=(usersize+1);i<count;i++){
- if(mail[i]=='.'){
- break;
- }
- else{
- url[j] = mail[i];
- j++;
- }
- }
- char chked[10] = "fightclub";
- char domain[j];
- for(int i=0;i<j;i++){
- domain[i] = url[i];
- }
- for(int x=0;x<j;x++){
- if(domain[x]==chked[x]){
- }
- else{
- printf("INVALID\n");
- return 0;
- }
- }
- printf("VALID\n");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement