UVa 272_ACM_ Simulations

Source: Internet
Author: User

Background: Write a mock up today for 10 hours, still not fruit, so water this topic to be happy.

Train of thought: one-by-one read, the quotation marks are exchanged interchangeably with the specified quotation marks.

Learn:

1. Special quotes Here are special characters that are not character with the 255-character ASCII table, so they can only be exported as string constants.

2. The sense of simplicity of conditional expression.

3.

<span style= "FONT-SIZE:18PX;" > (Temp=getchar ()). =eof//brackets cannot be omitted. </span>
Operator Precedence: The relational operator is greater than the logical budget character greater than the copy operator, and the comma is the smallest.

4.gets to read almost unlimited strings, so C11 has been canceled, preferably not to use. But scanf a space or tab will stop reading the string, so use GetChar (), pay attention to details.

5. Carriage return line break, under Windows is ' \ n ', ' \ R ' under Linux is ' \ n ' and under MacOS is ' \ R ' under Windows GetChar Read Only ' \ n ', while on Linux first ' \ r ' and then ' \ n '.

My Code:

#include <stdio.h>
int main (void) {
    char temp;
    BOOL Key=true;
    while ((Temp=getchar ())!=eof) {
        if (temp!= ' ") printf ("%c ", temp);
        else{
            printf ("%s", key?) ``":"''");
            Key=!key
        }
    }
    return 0;
}


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.