Index: demo/coloring.cc
===================================================================
--- demo/coloring.cc	(revision 1435)
+++ demo/coloring.cc	(revision 1560)
@@ -6,8 +6,24 @@
 #include <lemon/graph_to_eps.h>
 
+#include <fstream>
+#include <iostream>
+
+
 using namespace std;
 using namespace lemon;
 
-int main() {
+int main(int argc, char *argv[]) 
+{
+  if(argc<2)
+  {
+      std::cerr << "USAGE: coloring <input_file.lgf>" << std::endl;
+      std::cerr << "The file 'input_file.lgf' has to contain a graph in LEMON format together with a nodemap called 'coords' to draw the graph (e.g. sample.lgf is not such a file)." << std::endl;
+      return 0;
+  }
+
+
+  //input stream to read the graph from
+  std::ifstream is(argv[1]);
+
   typedef UndirSmartGraph Graph;
   typedef Graph::Node Node;
@@ -18,5 +34,5 @@
   Graph graph;
 
-  UndirGraphReader<Graph> reader(std::cin, graph);
+  UndirGraphReader<Graph> reader(is, graph);
   Graph::NodeMap<xy<double> > coords(graph);
   reader.readNodeMap("coords", coords);
Index: demo/lp_maxflow_demo.cc
===================================================================
--- demo/lp_maxflow_demo.cc	(revision 1518)
+++ demo/lp_maxflow_demo.cc	(revision 1560)
@@ -1,2 +1,27 @@
+/* -*- C++ -*-
+ * demo/lp_maxflow_demo.cc - Part of LEMON, a generic C++ optimization library
+ *
+ * Copyright (C) 2005 Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
+ * (Egervary Research Group on Combinatorial Optimization, EGRES).
+ *
+ * Permission to use, modify and distribute this software is granted
+ * provided that this copyright notice appears in all copies. For
+ * precise terms see the accompanying LICENSE file.
+ *
+ * This software is provided "AS IS" with no warranty of any kind,
+ * express or implied, and with no claim as to its suitability for any
+ * purpose.
+ *
+ */
+
+///\ingroup demos
+///\file
+///\brief Max flow problem solved with an LP solver (demo).
+///
+///This demo program shows how to solve a maximum (or maximal) flow
+///problem using the LEMON LP solver interface. We would like to lay
+///the emphasis on the simplicity of the way one can formulate the LP
+///constraints with LEMON that arise in graph theory.
+
 #ifdef HAVE_CONFIG_H
 #include <config.h>
@@ -5,4 +30,7 @@
 #include<lemon/graph_reader.h>
 #include<lemon/list_graph.h>
+
+#include <fstream>
+#include <iostream>
 
 
@@ -76,6 +104,18 @@
 }
 
-int main() 
+int main(int argc, char *argv[]) 
 {
+  if(argc<2)
+  {
+      std::cerr << "USAGE: lp_maxflow_demo <input_file.lgf>" << std::endl;
+      std::cerr << "The file 'input_file.lgf' has to contain a max flow instance in LEMON format (e.g. sample.lgf is such a file)." << std::endl;
+      return 0;
+  }
+
+
+  //input stream to read the graph from
+  std::ifstream is(argv[1]);
+
+
   ListGraph g;
   ListGraph::Node s;
@@ -84,11 +124,8 @@
   ListGraph::EdgeMap<double> cap(g);
   
-  GraphReader<ListGraph> reader(std::cin,g);
+  GraphReader<ListGraph> reader(is,g);
   reader.readNode("source",s).readNode("target",t)
     .readEdgeMap("capacity",cap).run();
   
-  // std::ifstream file("../test/preflow_");
-//   readDimacs(file, g, cap, s, t);
-
   std::cout << "Max flow value = " << maxFlow(g,cap,s,t) << std::endl;
 
Index: demo/sub_graph_adaptor_demo.cc
===================================================================
--- demo/sub_graph_adaptor_demo.cc	(revision 1544)
+++ demo/sub_graph_adaptor_demo.cc	(revision 1560)
@@ -1,5 +1,5 @@
 // -*- c++ -*-
 
-// Use a DIMACS max flow file as stdin.
+// Use a DIMACS max flow file as input.
 // sub_graph_adaptor_demo < dimacs_max_flow_file
 // This program computes a maximum number of edge-disjoint shortest paths
@@ -22,6 +22,17 @@
 using std::endl;
 
-int main()
-{    
+int main(int argc, char *argv[]) 
+{
+  if(argc<2)
+  {
+      std::cerr << "USAGE: sub_graph_adaptor_demo <input_file.dim>" << std::endl;
+      std::cerr << "The file 'input_file.dim' has to contain a max flow instance in DIMACS format (e.g. sub_graph_adaptor_demo.dim is such a file)." << std::endl;
+      return 0;
+  }
+
+
+  //input stream to read the graph from
+  std::ifstream is(argv[1]);
+
   typedef SmartGraph Graph;
 
@@ -36,5 +47,5 @@
   LengthMap length(g);
 
-  readDimacs(std::cin, g, length, s, t);
+  readDimacs(is, g, length, s, t);
 
   cout << "edges with lengths (of form id, source--length->target): " << endl;
