Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <string.h>
- int main(){
- int i=0,j=0;
- char string1[200],string2[200],tmp1[200],tmp2[200];
- gets(string1);
- gets(string2);
- for(i=0;i<200;i++) {
- if (string1[i] != ' ') {
- tmp1[i]=string1[i];
- } else {
- i--;
- }
- }
- for(i=0;i<200;i++) {
- if (string2[i] != ' ') {
- tmp2[i]=string2[i];
- } else {
- i--;
- }
- }
- for(i=0;i<200;i++) {
- for(j=0;j<200;j++) {
- if(tmp1[i]==tmp2[j]) {
- tmp1[i]=0;
- tmp2[j]=0;
- }
- }
- }
- for(i=0;i<200;i++) {
- if (tmp1[i]!=0) {
- printf("Te ciagi to nie anagramy!\n");
- break;
- }
- if (tmp2[i]!=0) {
- printf("Te ciagi to nie anagramy!\n");
- break;
- } else {
- printf("Te ciagi to anagramy!\n");
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement