Issue One hundred and twenty-four: character filtering

Source: Internet
Author: User

[Plain] Description
 
Enter a string str and a filter string s (representing a filter table) to filter out all characters from the filter table in str.
 
Input
 
There are two rows of input data, the first row of str, the second row of s, and the string cannot exceed 70 characters.
 
Output
 
Output the filtered string.
 
Sample Input
 
 
Asf $ a sf $
$
 
Sample Output
 
 
Sf

Description

Enter a string str and a filter string s (representing a filter table) to filter out all characters from the filter table in str.

Input

There are two rows of input data, the first row of str, the second row of s, and the string cannot exceed 70 characters.

Output

Output the filtered string.

Sample Input


Asf $ a sf $
$

Sample Output


Sf


[Plain] # include <stdio. h>
# Include <string. h>
 
Int main ()
{
Int I;
Int j;
Int l;
Int n;
Int m;
Char a [70];
Char B [70];
Char c [70];
 
Gets ();
Gets (B );
 
N = strlen ();
M = strlen (B );

For (I = 0; I <m; I ++)
{
L = 0;
For (j = 0; j <n; j ++)
{
If (a [j]! = B [I])
{
C [l ++] = a [j];
}
}
C [l] = 0;
 
For (j = 0; j <l; j ++)
{
A [j] = c [j];
}
 
N = l;
A [j] = 0;
}
 
For (I = 0; c [I]; I ++)
{
Printf ("% c", c [I]);
}
 
Return 0;
}

# Include <stdio. h>
# Include <string. h>

Int main ()
{
Int I;
Int j;
Int l;
Int n;
Int m;
Char a [70];
Char B [70];
Char c [70];

Gets ();
Gets (B );

N = strlen ();
M = strlen (B );

For (I = 0; I <m; I ++)
{
L = 0;
For (j = 0; j <n; j ++)
{
If (a [j]! = B [I])
{
C [l ++] = a [j];
}
}
C [l] = 0;

For (j = 0; j <l; j ++)
{
A [j] = c [j];
}

N = l;
A [j] = 0;
}

For (I = 0; c [I]; I ++)
{
Printf ("% c", c [I]);
}

Return 0;
}



 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.