Baiti 2743 string judgment and other problem-solving reports

Source: Internet
Author: User

Link: http://poj.grids.cn/practice/2743/

Question:

Total time limit:
1000 ms
Memory limit:
65536kB
Description
Determines whether two strings consisting of uppercase and lowercase letters and spaces are equal after the case is ignored or the space is compressed.
Input
The fifth row is the number of test data groups n, each group of test data occupies 2 rows, 1st rows are the first string s1, and 1st rows are the second string s2.
There is an empty row between each group of test data. Each row has no more than 100 characters (note that the string length may be 0)
Output
N rows. If n rows are equal, YES is output; otherwise NO is output.
Sample Input
3a A bb BB ccc CCCAa BBbb CCCccca              dfadf              fasdfadasddfsfsaf
Sample output
YESYESNO

Code:

 #include <iostream> #include <cstdio> #include <cstdlib> #include <cstring>                        cin>>                s1[],s2[],s3[],s4[     (n--                       len1 =          len2 =                   idx1 =          ( i = ; i < len1; i++              (s1[i] !=                    (s1[i] >=  && s1[i] <= ) s3[idx1++] = (s1[i]-) +                   s3[idx1++] =           s3[idx1] =                   idx1 =          ( i = ; i < len2; i++              (s2[i] !=                    (s2[i] >=  && s2[i] <= ) s4[idx1++] = (s2[i] - ) +                   s4[idx1++] =           s4[idx1] =                            (strcmp(s3,s4)) cout<<<<          cout<<<<        }

Ideas:

1. Pay attention to empty rows between test instances

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.