Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
- void anagram(char*niza1,char*niza2,int n,int m){
- for(int i=0;i<n;i++){
- for(int j=0;j<m;j++)
- {
- if(niza1[i]==niza2[j]){
- niza2[j]='#';
- break;
- }
- }
- }
- printf("%s\n", niza2);
- for(int j=0;j<m;j++)
- {
- if(niza2[j]!='#'){
- printf("Nizite ne se anagrami");
- return;
- }
- }
- printf("Nizite se anagrami\n");
- }
- int main()
- {
- char niza1[101],niza2[101];
- scanf("%s",niza1);
- scanf("%s",niza2);
- anagram(niza1,niza2, strlen(niza1), strlen(niza2));
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement