Search found 3 matches

by Wedson
Sat Dec 29, 2001 4:40 am
Forum: Volume 2 (200-299)
Topic: 218 - Moth Eradication
Replies: 60
Views: 19703

I got the following output (for the given input) from my program, which was accepted:

Region #1:
(0.0,0.0)-(0.0,3.0)-(3.0,3.0)-(2.0,2.0)-(1.0,1.0)-(0.0,0.0)
Perimeter length = 10.24

Region #2:
(5.0,5.0)-(5.0,5.0)
Perimeter length = 0.00

Region #3:
(1.0,1.0)-(5.0,6.0)-(1.0,1.0)
Perimeter length ...
by Wedson
Tue Dec 18, 2001 3:19 am
Forum: C++
Topic: Append File
Replies: 1
Views: 2305

In C++, files are represented using streams, so you should use file streams instead of those C-like FILE structs (although FILE structs are also part of C++). Here's a way of doing this in C++:

#include <fstream>

int main() {
ofstream f("test.txt", ios::app);

if (f) {
f << "New linen";
f ...
by Wedson
Sun Nov 25, 2001 8:51 pm
Forum: Volume 1 (100-199)
Topic: 108 - Maximum Sum
Replies: 233
Views: 51682

The #include is OK. Appending ".h" to the header filename is a C convention, not C++. The C++ header that defines numeric_limits is <limits>, if someone wants to include C's <limits.h> in C++ should include <climits>.

Go to advanced search