Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- for(i = 0; i < 5; i++) {
- if(word1[i] == word2[i]) {
- result[i] = word1[i];
- }else{
- result[i] = '-';
- }
- }
- for(i = 0; i < 5; i++){
- pch = strchr(word2, word1[i]);
- if(pch!=NULL) {
- pch2 =strchr(result, word1[i]);
- if(pch2==NULL) {
- result[pch-word2] = '*';
- }
- }
- }
Add Comment
Please, Sign In to add comment