Advertisement
helos3

lab1

Oct 5th, 2014
191
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. #include <vcl.h>
  2. #include <iostream>
  3. #include <windows.h>
  4. #include <math.h>
  5. #include <stdio.h>
  6. #include <string.h>
  7.  
  8. using namespace std;
  9.  
  10. int _tmain(int argc, _TCHAR* argv[])
  11. {
  12. char s[50], wrd[48], c;
  13. int j,i,z;
  14. bool word[2][24];
  15. cin.getline(s,50);
  16. for (j = 1; j < 8; j++) {
  17. word[1][j]=true;
  18. word[2][j]=false;
  19. }
  20. j=1;
  21. for (i=1, i < strlen(s) , i++)
  22. if (s[i]!=' ') {
  23. wrd[j]=s[i];
  24. j++;
  25. } else {
  26. for (z=1; z<=j ; z++)
  27. word[2][(int)(wrd[z]) - (int)('A') + 1]=true;
  28. j=1;
  29. for (z=1; z < 24; z++) {
  30. if (word[1][z]==word[2][z] && word[2][z]=true)
  31. word[1][z]=word[2][z];
  32. word[2][z]=false;
  33. }
  34. }
  35. }
  36.  
  37.  
  38. for (z = 1; z < 24; i++) {
  39. if (word[1][i]) {
  40. printf("%c", word[1][i]);
  41. }
  42.  
  43. }
  44.  
  45.  
  46.  
  47. return 0;
  48. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement