Advertisement
Guest User

30% fightclub by alpha

a guest
Jul 22nd, 2017
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. #include<stdio.h>
  2. #include<string.h>
  3.  
  4. int main(){
  5. int count=0, usersize=0, vcheck;
  6. char mail[255];
  7.  
  8. scanf("%[^\n]", mail);
  9.  
  10.  
  11. char user[15];
  12. char url[20];
  13.  
  14. count = strlen(mail);
  15.  
  16. for(int i=0;i<count;i++){
  17. user[i]=mail[i];
  18. if(mail[i]=='@'){
  19. break;
  20. }
  21. else{
  22. usersize++;
  23. }
  24.  
  25. }
  26.  
  27. if(usersize<=6){
  28.  
  29. }
  30. else{
  31. printf("INVALID\n");
  32. return 0;
  33. }
  34.  
  35.  
  36.  
  37. int j=0;
  38. for(int i=(usersize+1);i<count;i++){
  39. if(mail[i]=='.'){
  40. break;
  41. }
  42. else{
  43.  
  44. url[j] = mail[i];
  45. j++;
  46. }
  47. }
  48.  
  49.  
  50. char chked[10] = "fightclub";
  51.  
  52. char domain[j];
  53. for(int i=0;i<j;i++){
  54. domain[i] = url[i];
  55. }
  56.  
  57. for(int x=0;x<j;x++){
  58. if(domain[x]==chked[x]){
  59.  
  60. }
  61. else{
  62. printf("INVALID\n");
  63. return 0;
  64. }
  65. }
  66. printf("VALID\n");
  67.  
  68.  
  69.  
  70. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement