Guest User

Untitled

a guest
Nov 17th, 2018
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. for(i = 0; i < 5; i++) {
  2. if(word1[i] == word2[i]) {
  3. result[i] = word1[i];
  4. }else{
  5. result[i] = '-';
  6. }
  7. }
  8.  
  9. for(i = 0; i < 5; i++){
  10. pch = strchr(word2, word1[i]);
  11.  
  12. if(pch!=NULL) {
  13. pch2 =strchr(result, word1[i]);
  14.  
  15. if(pch2==NULL) {
  16. result[pch-word2] = '*';
  17. }
  18. }
  19. }
Add Comment
Please, Sign In to add comment