1390 DNA sequence

Source: Internet
Author: User
Description

We already know that the DNA sequence is composed of four elements: A, T, C, and G. Now you work on the given Biological DNA sequence, we want to know whether another virus DNA sequence exists in this sequence. If so, yes is output; otherwise, no is output.

Input

The first line of the input data contains an integer T, indicating that there are T groups of data;

The format of each group of test data is as follows:

The first line contains a string S1 consisting of characters A, T, C, and G. The length cannot exceed 100,000.

The second line contains a string S2 consisting of characters A, T, C, and G. The length cannot exceed 1,000.

Output

If String S2 is a child string of S1, output yes; otherwise, output No

 

Call the find function in STL.

# Include <iostream> # include <string> # include <cstdio> using namespace STD; int main () {int number, Te; string a; string B; scanf ("% d", & number); For (TE = 1; te <= number; Te ++) {CIN> A; CIN> B; if (. find (B) <= Number) printf ("Yes \ n"); elseprintf ("NO \ n ");}}

 

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.