Search found 14 matches
- Fri Apr 16, 2004 9:08 pm
- Forum: C++
- Topic: How do u check for eoln in C++?
- Replies: 3
- Views: 2572
You can read character by character until reading an end-of-line character. This code in Pascal: [pascal]var f:Text; c:Char; while not eoln(f) do begin Read(f, c); {do something with c} end; Readln(f);{advance to the next line} [/pascal] might become [cpp]ifstream inp; char c; while ((c = inp.get())...
- Mon Feb 10, 2003 6:18 pm
- Forum: Volume 2 (200-299)
- Topic: 273 - Jack Straws
- Replies: 19
- Views: 3207
Incorrect problem description (probem 273)
I think that the description of problem 273 is wrong. It states that 1 < n < 13, but when I sent my solution, I received Runtime Error. When I enlarged my arrays to hold more than 12 sticks, I got Wrong Answer. Then I submitted a solution that would go into an endless loop if n is not between 1 and ...
- Sun Feb 02, 2003 8:18 pm
- Forum: Pascal
- Topic: 64 bit integer in pascal
- Replies: 2
- Views: 3738
- Thu Jan 23, 2003 8:45 pm
- Forum: Algorithms
- Topic: Miller-Rabin test
- Replies: 2
- Views: 2635
- Tue Jan 14, 2003 9:02 pm
- Forum: Algorithms
- Topic: How to detect an arithmetic overflow
- Replies: 6
- Views: 3647
The right way to write detect_addition_overflow() is the following (see Leendert Ammeraal, Algorithms and Data Structures in C++, John Wiley & Sons, ISBN 0-471-96355-0): [cpp]inline int detect_addition_overflow(int a, int b, int overflow_value) { int result = a + b; if (result >= a) return result; e...
- Fri Jan 03, 2003 8:05 pm
- Forum: C
- Topic: linked lists
- Replies: 7
- Views: 3107
- Fri Jan 03, 2003 8:01 pm
- Forum: Volume 1 (100-199)
- Topic: 191 - Intersection
- Replies: 103
- Views: 18337
You have submitting problem. I guess you are using e-mail submission. Do you see the long one-line comment containing the word full? SMTP servers (the servers delivering electronic mail) and many e-mail clients love wrapping long lines, so what the judge receives is: // Check if both lines segments ...
- Fri Jan 03, 2003 7:45 pm
- Forum: C
- Topic: linked lists
- Replies: 7
- Views: 3107
- Sun Dec 08, 2002 4:56 pm
- Forum: Other words
- Topic: Change user name on board?
- Replies: 1
- Views: 1440
- Wed Dec 04, 2002 8:28 am
- Forum: Algorithms
- Topic: Minimum Cost Transport Algorithm
- Replies: 3
- Views: 2578
- Thu Nov 28, 2002 10:29 pm
- Forum: C++
- Topic: Old G++ version unacceptable
- Replies: 4
- Views: 2833
'Old C++ compiler unacceptable' and 'Compilation with optimization turned off unaccepteble' are two quite different things. I don't like the lack of optimization, but I understand the administrators, as they have only one computer to run a web server, mail server, to compile solutions and to run the...
- Wed Nov 20, 2002 8:44 am
- Forum: C++
- Topic: Grow Array Size
- Replies: 13
- Views: 4543
Your 'growing' code should not work as the two parts of the array, the one you allocate with [cpp]num = new int[5];[/cpp] and the one allocated with [cpp]pnum = new int[10];[/cpp] will be at different (not near) addresses in the general case. [cpp]pnum = &num[4];[/cpp] does nothing when followed by ...
- Sun Nov 17, 2002 2:02 pm
- Forum: C++
- Topic: Using Long Long s
- Replies: 1
- Views: 1633
- Sun Nov 17, 2002 1:53 pm
- Forum: C++
- Topic: Something's terribly wrong with long long ints
- Replies: 1
- Views: 1548