Poj 1750 dictionary

Source: Internet
Author: User

[Description]: I want to understand the meaning of the question based on the input and output, and I will not describe it any more.

[Analysis]: The most dislike of the string problem, alas, see the code. The processing methods are all in the code. Note that this question is always the same as the two adjacent strings. It can be easily solved by grasping this point.

For details, see the code:

// 196 K 1000 ms # include <iostream> # include <cstdio> # include <cstring> using namespace STD; char str1 [100], str2 [100]; int main () {int samenum = 0, spacenum = 0; // the same number of characters, as well as the number of spaces int I; CIN >>str1; cout <str1 <Endl; while (CIN> str2) {for (I = 0; I <strlen (str1), I <strlen (str2); I ++) if (str1 [I]! = Str2 [I]) break; if (I> samenum) spacenum ++; else spacenum = I; samenum = spacenum; for (I = 0; I <spacenum; I ++) putchar (""); cout <str2 <Endl; strcpy (str1, str2);} return 0 ;}


Poj 1750 dictionary

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.