Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Memory limit: 2 5 6 Mb Time limit: 1 0 0 0 ms Input file: stdin Output file: stdout Task: You are given a set

Memory limit: 256 Mb
Time limit: 1000 ms
Input file: stdin
Output file: stdout
Task:
You are given a set of strings separated with line feed characters.
Find all the substrings that are correct assignment statements.
The general formula for a valid assignment statement is x = y;, where x is the first operand, y is the second operand. Note that there may be several whitespace characters between the operands.
In this task a string is considered to be a correct assignment statement when:
1) a variable is assigned to a constant value;
2) a variable is assigned to another variable;
3) a variable is assigned to an arithmetic expression;
4) a variable is assigned to an array element which index is either a numeric value or a variable.
For example, the strings "a3r=7;","a = b ;","a[i]=b[j];","a=z[2];","a=f*2;","a[5]=z+a;","a = z[i]+11;" are considered to be correct assignment statements (note that there is a semicolon at the end of each statement).
The strings "a=6","a-=10;","a+=n;","d=#$&_h","a*=r;" are considered to be incorrect.
Input:
A set of strings separated with line feed characters.
Output:
All the longest correct substrings in the order in which they appear in the text, separating each with a line feed character.
** Use only C++**
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Privacy In Statistical Databases International Conference Psd 2022 Paris France September 21 23 2022 Proceedings Lncs 13463

Authors: Josep Domingo-Ferrer ,Maryline Laurent

1st Edition

3031139445, 978-3031139444

More Books

Students also viewed these Databases questions