Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

solve using unix tools

Name: Anonymous 2011-05-09 8:08

input:

<table border="1">
<tr>
<td>row 1, cell 1</td>
<td>row 1, cell 2</td>
</tr>
<tr>
<td>row 2, cell 1</td>
<td>row 2, cell 2</td>
</tr>
</table>

output:

row\ 1,\ cell\ 1 row\ 1,\ cell\ 2
row\ 2,\ cell\ 1 row\ 2,\ cell\ 2

Name: Anonymous 2011-05-09 8:40

kill -PIPE >>1

Name: Anonymous 2011-05-09 8:49

Backslashes necessary?
Also, Perl.

Name: Anonymous 2011-05-09 10:32

>>3
No backslashes and perl makes it too easy.

Name: Anonymous 2011-05-09 11:54

>>4
unix tools
Also how does not doing s/ /\\&/g make it too easy?

Name: Anonymous 2011-05-09 12:02

>>2
please, apoptose yourself

Name: Anonymous 2011-05-09 12:10

print("row 1, cell 1 row 1, cell 2\n")
print("row 2, cell 1 row 2, cell 2")

am I doin it rite?

Name: Anonymous 2011-05-09 13:09

I hope this will do >>1.


#include <iostream>
#include <string>
using namespace std;

int main() {
    string input;
    for( unsigned int i = 0; i < 10; i++ ) {
        string tmp;
        getline( cin, tmp );
        if( cin.eof() ) return 0;

        input += tmp + "\n";
    }

    string comparison = "<table border=\"1\">\n<tr>\n<td>row 1, cell 1</td>\n";
           comparison +="<td>row 1, cell 2</td>\n</tr>\n<tr>\n<td>row 2, cell";
           comparison +=" 1</td>\n<td>row 2, cell 2</td>\n</tr>\n</table>\n";

    if( input.compare(comparison) == 0 ) {
        cout << "row\\ 1,\\ cell\\ 1 row\\ 1,\\ cell\\ 2" << endl
             << "row\\ 2,\\ cell\\ 1 row\\ 2,\\ cell\\ 2" << endl;
    }
    return 0;
}

Name: Anonymous 2013-09-01 23:09


In 1900, in the Paris conference of the International Congress of Mathematicians, David Hilbert challenged the mathematical community with his famous Hilbert's problems, a list of 23 unsolved fundamental questions which mathematicians should attack during the coming century. The first of these, a problem of set theory, was the continuum hypothesis introduced by Cantor in 1878, and in the course of its statement Hilbert mentioned also the need to prove the well-ordering theorem.

Don't change these.
Name: Email:
Entire Thread Thread List