lehrkraefte:blc:informatik:ffprg2017:ln:ln

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
lehrkraefte:blc:informatik:ffprg2017:ln:ln [2017/11/10 08:11]
Ivo Blöchliger
lehrkraefte:blc:informatik:ffprg2017:ln:ln [2017/11/10 08:39] (current)
Ivo Blöchliger [Programmieren mit C++]
Line 3: Line 3:
   * Unter Linux: gcc + Text-Editor   * Unter Linux: gcc + Text-Editor
   * Windows: gcc + MINGW + Texteditor oder VisualC++?   * Windows: gcc + MINGW + Texteditor oder VisualC++?
-  * Mac? Keine Ahnung... wohl gc + Text-Editor oder X-Code?+  * Mac? Keine Ahnung... wohl gcc + Text-Editor oder X-Code?
  
 === Hello World === === Hello World ===
Line 33: Line 33:
 // Solve problem // Solve problem
 int solve(int n, int s, int p[]) { int solve(int n, int s, int p[]) {
-  return (p[0]<p[1]) ? p[1] : p[0];+  // Solve problem here 
 +  // Return solution
   return 42;   return 42;
 } }
Line 58: Line 59:
 </code> </code>
  
 +== Testdaten ==
 +<code txt sub1.txt>
 +2
 +2 0
 +16 42
 +2 0
 +100 64
 +</code>
 +
 +== Ausführen ==
 +Nach dem Compilieren z.B. mit
 +<code bash>
 +  ./sub1.exe < sub1.txt
 +</code>
 +wird der Inhalt der Datei sub1.txt eingelesen, als ob dies auf der Tastatur eingegeben worden wäre.
 == Makefile == == Makefile ==
 Für jene ohne IDE, hier ein generisches Makefile: Für jene ohne IDE, hier ein generisches Makefile:
-<code makefile>+<code makefile Makefile>
 SOURCES=$(wildcard *.cpp) SOURCES=$(wildcard *.cpp)
 TARGETS=$(patsubst %.cpp,%.exe,$(SOURCES)) TARGETS=$(patsubst %.cpp,%.exe,$(SOURCES))
  • lehrkraefte/blc/informatik/ffprg2017/ln/ln.1510297914.txt.gz
  • Last modified: 2017/11/10 08:11
  • by Ivo Blöchliger