Guest User

Untitled

a guest
Dec 11th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. #include<string.h>
  2. #include<stdio.h>
  3. #include<conio.h>
  4. void main()
  5. {
  6. char p[10],pwd[10];
  7. int i,j,count[10],c=0;
  8. clrscr();
  9. input:
  10. printf("ENTER PASSWORD IN UPPERCASE ONLY:");
  11. gets(pwd);
  12. for(i=0;i<strlen(pwd);i++)
  13. {
  14. if(pwd[i]==tolower(pwd[i]))
  15. goto input;
  16. }
  17. for(i=0;i<10;i++)
  18. count[i]=0;
  19. for(i=0;i<10;i++)
  20. {
  21. for(j=0;j<=i;j++)
  22. {
  23. if((pwd[i]==pwd[j])&&(pwd[i+1]==pwd[j+1]))
  24. {
  25. count[i]++;
  26. }
  27. else if(pwd[i]==pwd[j]&&pwd[i]==pwd[j+1])
  28. count[i]++;
  29. if(count[i]==1)
  30. p[i]='\0';
  31. else
  32. p[i]=pwd[i];
  33. }
  34. }
  35. for(i=0;i<10;i++)
  36. {
  37. if(p[i]=='\0')
  38. c++;
  39. }
  40. if(c==10)
  41. printf("ACCEPTED");
  42. else
  43. printf("REJECTED");
  44. getch();
  45. }
Add Comment
Please, Sign In to add comment