Scissor Strips 2087

Source: Internet
Author: User

Problem description A piece of flower cloth, there are some patterns, there is a directly available small bar, there are some patterns. For a given strip of flowers and strips, calculate how many pieces of strips can be cut from the flower cloth?

Input inputs contain some data, respectively, is a pair of flowers and small strips, the cloth is shown with visible ASCII characters, the number of visible ASCII characters, the pattern of the cloth is also how many kinds of patterns. The strips and strips are not more than 1000 characters in length. If you meet the # character, you are no longer working.

Output outputs can be cut from the pattern cloth up to the number of small strips, if not a piece, then honestly output 0, each result should be wrapped.

Sample INPUTABCDE a3aaaaaa aa#

Sample Output03

Authorqianneng

SOURCE Winter Practice Sanjiu II

Recommendlcy | We have carefully selected several similar problems for you:1711 1686 3746 3336 1358 strstr application:
1#include <stdio.h>2#include <iostream>3 using namespacestd;4#include <string.h>5 intMain ()6 {7     Chars[1024x768],a[1024x768];8      while(SCANF ("%s", &s) &&s[0]!='#'&AMP;&AMP;SCANF ("%s",&a))9     {Ten         intCount=0; One         Char*p=s; A         intlen=strlen (a); -          while*pb=strstr (P,a)) { -count++; thep + =Len; -         } -cout<<count<<Endl; -     } +}

Find application:

1#include <iostream>2#include <stdio.h>3#include <string>4#include <algorithm>5 using namespacestd;6 intMain ()7 {8     stringb;9     intPos,count=0;TenCin>>A; OneCin>>b; A  -Pos=a.find (b);//CCABCBBGABCHUHIABC -     //cout<<pos<<endl; the      while(pos!=-1) -     {  -count++; -Pos=a.find (b,pos+b.size ()); +          -     } +cout<<count<<Endl; A     return 0; at}

Scissor Strips 2087

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.