31.01.2014 Views

Version 5.0 The LEDA User Manual

Version 5.0 The LEDA User Manual

Version 5.0 The LEDA User Manual

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 2<br />

Basics<br />

An extended version of this chapter is available as chapter Foundations of [64]<br />

2.1 Getting Started<br />

Please use your favourite text editor to create a file prog.c with the following program:<br />

#include <br />

#include <br />

#include <br />

using std::cin;<br />

using std::cout;<br />

using std::endl;<br />

using leda::string;<br />

using leda::d_array;<br />

int main()<br />

{<br />

d_array N(0);<br />

string s;<br />

while (cin >> s) N[s]++;<br />

forall_defined (s,N)<br />

cout

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!