Advertisement
Guest User

Untitled

a guest
May 19th, 2017
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.66 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <string.h>
  3.  
  4. int main(){
  5.  
  6. int i=0,j=0;
  7. char string1[200],string2[200],tmp1[200],tmp2[200];
  8. gets(string1);
  9. gets(string2);
  10.  
  11. for(i=0;i<200;i++) {
  12. if (string1[i] != ' ') {
  13. tmp1[i]=string1[i];
  14. } else {
  15. i--;
  16. }
  17. }
  18.  
  19. for(i=0;i<200;i++) {
  20. if (string2[i] != ' ') {
  21. tmp2[i]=string2[i];
  22. } else {
  23. i--;
  24. }
  25. }
  26.  
  27. for(i=0;i<200;i++) {
  28. for(j=0;j<200;j++) {
  29. if(tmp1[i]==tmp2[j]) {
  30. tmp1[i]=0;
  31. tmp2[j]=0;
  32. }
  33. }
  34. }
  35.  
  36. for(i=0;i<200;i++) {
  37. if (tmp1[i]!=0) {
  38. printf("Te ciagi to nie anagramy!\n");
  39. break;
  40. }
  41. if (tmp2[i]!=0) {
  42. printf("Te ciagi to nie anagramy!\n");
  43. break;
  44. } else {
  45. printf("Te ciagi to anagramy!\n");
  46. }
  47. }
  48.  
  49. return 0;
  50. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement