NOIP Improvement Group C Actual Entry File Operations

Updated on technology 2024-04-12
9 answers
  1. Anonymous users2024-02-07

    Normally, I don't write, but if I write, I have to write well.

    Here's a C++ program.

    It's concise and efficient, just delete my comments.

    It embodies the beauty of C++**.

    It can handle arbitrary long files, vector dynamic arrays.

    You don't need anything like define max len 10.

    C++ deserves to be called Butter C

    #include

    #include

    #include

    #include

    using namespace std;

    int main()

    ifstream fin("");

    if(cout<<"The file failed to open"<> str;Read the contents of the file into the str string.

    vectordata;Create array datafor(int i=0; i<;i++)

    All data is read from str and saved in the array data.

    for(int i=0;i<;i++)

    coutofstream fout("");

    fout<<"0123456789";

    Create a file according to your requirements and output 0123456789return 0;

  2. Anonymous users2024-02-06

    RB: binary read.

    wb: written in binary mode.

  3. Anonymous users2024-02-05

    Because the NOIP evaluation is purely machine-based, the test data is not manually entered from the keyboard, but has been prepared in a file in memory. For example, in this file in the d: program folder.

    The output data is not directly output from the screen, but is stored as a file. Therefore, it is necessary to use the method of input and output files.

    For example, if the question asks for an input file name, the output file name is a name. This means that the data and results that need to be tested are stored in these two files, and the machine automatically takes the data from it for calculation, and then compares the running results with the inside, and the consistency is considered to be correct, and the inconsistency is wrong.

    Then we only need to add the relevant ** when we write the program.

  4. Anonymous users2024-02-04

    It's hard to say clearly, do you want to participate in the popularization group or improve? You send me a message, and I'll add you QQ back

  5. Anonymous users2024-02-03

    It's all right.

    Long double is not necessary, it seems that it is really unusable, and the commonly used thing is vector as an adjacency table.

    Then set、Map is used like this.,But if the data exceeds 10w, it's best not to use it.,Slow out of the flight.。

    queue、deque、stack, the speed is acceptable, file operations, you freopen, fopen can turn off stream synchronization, you can use, but try to use less cincout, the speed is too slow, anyway, try to use stl as little as possible, the speed is too slow, it's better to write the stl version first and then change to the version you wrote.

  6. Anonymous users2024-02-02

    The output is 150.

    First enter 4, 6 then the e array is e[4][6] and has been initialized to -1, then enter the value of a, b, c is the one you wrote with the title, and then the visted[i] array is initialized to false, and the initial value of ans is 0; , and then call the dfs() function four times in a row, and the dfs() function is called recursively.

    subfunctions. When x=1, visted(1)=ture, len=0, ans=0, so if() in the subfunction is not executed. Start executing the for() loop, i=1

    visted(1)=ture, so when i=1, the if in for is not executed, and then visted(1)=false;

    When x=2, visted(2)=ture, len=0, ans=0, so if() in the subfunction is not executed. Start executing the for() loop, i=1

    If the execution condition is satisfied, the dsf() function len=len+e[2][1]=10 is recursively called

  7. Anonymous users2024-02-01

    The preliminary round is divided into 4 major questions:

    1. Select (multiple choice).

    2. Problem solving (some math problems).

    3. Look at the program writing results.

    4. Improve procedures.

    Note: Both 3 and 4 are more difficult than the universal group).

    There are a total of 4 questions in the semi-finals, with a total score of 100 points for each question, the first three questions have 10 test points and 10 points each, and the fourth question generally has 20 test points with 5 points each.

    The content is not necessarily, you can find some past papers to do.

  8. Anonymous users2024-01-31

    Insertion operations are basically supported.

    As for taking the minimum value, there is also min() in the standard algorithm library.

  9. Anonymous users2024-01-30

    Visual inspection is not supported.

    Although the latest Noi-Linux (G++ version is available, the default standard is C++98.

    Personally, I don't think the evaluator will add the compilation parameter -std=c++11.

    In addition, GCC has only modified the standard used by default, see "The default mode for C++ is now -std=gnu++14 instead of -std=gnu++98.""

Related questions
24 answers2024-04-12

It's not that the car is getting worse and worse, but we can also see that the current record is getting closer and closer to the record of the old-timers, and Pagani Zonda R has narrowed the gap to half a minute. In fact, it's not that the current cars are getting worse and worse, but that the Porsche 956 is so terrifying that even the best racing cars were terrified when they heard its name. >>>More

4 answers2024-04-12

The specific measures taken by the Head of Year to manage the grade are as follows: >>>More

10 answers2024-04-12

Activities to improve team cohesion include the following: >>>More