Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <vcl.h>
- #include <iostream>
- #include <windows.h>
- #include <math.h>
- #include <stdio.h>
- #include <string.h>
- using namespace std;
- int _tmain(int argc, _TCHAR* argv[])
- {
- char s[50], wrd[48], c;
- int j,i,z;
- bool word[2][24];
- cin.getline(s,50);
- for (j = 1; j < 8; j++) {
- word[1][j]=true;
- word[2][j]=false;
- }
- j=1;
- for (i=1, i < strlen(s) , i++)
- if (s[i]!=' ') {
- wrd[j]=s[i];
- j++;
- } else {
- for (z=1; z<=j ; z++)
- word[2][(int)(wrd[z]) - (int)('A') + 1]=true;
- j=1;
- for (z=1; z < 24; z++) {
- if (word[1][z]==word[2][z] && word[2][z]=true)
- word[1][z]=word[2][z];
- word[2][z]=false;
- }
- }
- }
- for (z = 1; z < 24; i++) {
- if (word[1][i]) {
- printf("%c", word[1][i]);
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement