Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
H
hp
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Daniel
hp
Commits
7728eeec
Commit
7728eeec
authored
7 years ago
by
Peter Gerwinski
Browse files
Options
Downloads
Patches
Plain Diff
Update Übungsaufgaben 9.10.2017
parent
48669803
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
20171009/hp-uebung-20171009.pdf
+0
-0
0 additions, 0 deletions
20171009/hp-uebung-20171009.pdf
20171009/hp-uebung-20171009.tex
+30
-51
30 additions, 51 deletions
20171009/hp-uebung-20171009.tex
README.md
+1
-1
1 addition, 1 deletion
README.md
common/pgscript.sty
+7
-1
7 additions, 1 deletion
common/pgscript.sty
with
38 additions
and
53 deletions
20171009/hp-uebung-20171009.pdf
+
0
−
0
View file @
7728eeec
No preview for this file type
This diff is collapsed.
Click to expand it.
20171009/hp-uebung-20171009.tex
+
30
−
51
View file @
7728eeec
...
@@ -23,15 +23,8 @@
...
@@ -23,15 +23,8 @@
\documentclass
[a4paper]
{
article
}
\documentclass
[a4paper]
{
article
}
\usepackage
{
pgscript
}
\usepackage
{
pgscript
}
\usepackage
{
pdftricks
}
\begin{psinputs}
\thispagestyle
{
empty
}
\usepackage
{
pgscript
}
\definecolor
{
PracticallyWhite
}{
rgb
}{
0.99 0.99 0.99
}
\end{psinputs}
\newcounter
{
exercise
}
\newcommand
{
\exercise
}
[1]
{
\addtocounter
{
exercise
}{
1
}
\subsection*
{
Aufgabe
\arabic
{
exercise
}
: #1
}}
\begin{document}
\begin{document}
...
@@ -42,45 +35,41 @@
...
@@ -42,45 +35,41 @@
\exercise
{
Hello, world!
}
\exercise
{
Hello, world!
}
Bringen Sie das klassische "`Hello world!"'-Programm
Unter
\url
{
https://gitlab.cvh-server.de/pgerwinski/hp/tree/master/20171009
}
auf Ihrem Rechner und/oder auf einem Rechner der Hochschule
finden Sie eine Auswahl an Beispielprogrammen:
unter einem Betriebssystem Ihrer Wahl zum Laufen:
\begin{enumerate}
[
\quad
(a)]
\item
\gitfile
{
hp
}{
20171009
}{
hello.c
}
\begin{lstlisting}
\item
\gitfile
{
hp
}{
20171009
}{
hello-opengl.c
}
#include <stdio.h>
\item
\gitfile
{
hp
}{
20171009
}{
hello-gtk.c
}
\end{enumerate}
int main (void)
Bringen Sie diese Programme auf Ihrem eigenen Rechner
{
und/oder auf einem Rechner der Hochschule
printf ("Hello, world!
\n
");
unter einem Betriebssystem Ihrer Wahl zum Laufen.
return 0;
}
\file
{
hello.c
}
ist das klassische "`Hello, world!"'-Programm.
\end{lstlisting}
\file
{
hello-gtk
}
erzeugt ein Fenster mit einem Button zum Schließen,
\file
{
hello-opengl
}
erzeugt ein Fenster, das nach 5 Sekunden
von selbst wieder verschwindet.
\textbf
{
Hinweis 0:
}
Diese PDF-Datei enthält Links zu den jeweiligen Dateien.
Durch Anklicken können Sie diese direkt herunterladen.
\textbf
{
Hinweis 1:
}
Für (b) und (c) benötigen Sie die Bibliotheken
GTK+ sowie OpenGL einschließlich GLUT oder FreeGLUT.
Diese finden Sie -- einschließlich Dokumentation --
als freie Software im Internet.
Hinweis:
\textbf
{
Hinweis 2:
}
Unter Unix mit
\lstinline
[style=cmd]
{
gcc
}
geht das Compilieren und Starten der Programme folgendermaßen:
\begin{lstlisting}
[style=cmd]
\begin{lstlisting}
[style=cmd]
gcc -Wall -O hello.c -o hello
gcc -Wall -O hello.c -o hello
./hello
./hello
gcc -Wall -O hello-opengl.c -lGL -lGLU -lglut -o hello-opengl
./hello-opengl
gcc
$
(
pkg
-
config
--
cflags
--
libs gtk
+-
3
.
0
)
-
Wall
-
O hello
-
gtk.c
-
o hello
-
gtk
.
/
hello
-
gtk
\end
{
lstlisting
}
\end
{
lstlisting
}
\exercise
{
Grafik-Bibliotheken
}
Unter
\url
{
https://gitlab.cvh-server.de/pgerwinski/hp/tree/master/20171009
}
finden Sie eine Auswahl an Beispielprogrammen, u.
\,
a.
\
das o.
\,
a.
\
"`Hello, world!"'-Programm.
Versuchen Sie, möglichst viele dieser Programme
auf Ihrem Rechner und/oder auf einem Rechner der Hochschule
unter einem Betriebssystem Ihrer Wahl zum Laufen zu bringen.
\file
{
hello-gtk
}
erzeugt ein Fenster mit einem Button zum Schließen.
Die anderen Beispielprogramme erzeugen Fenster, die nach 5 Sekunden
von selbst wieder verschwinden.
Hinweis: Sie benötigen dafür die jeweiligen Bibliotheken:
Allegro, GTK+, OpenGL einschließlich GLUT oder FreeGLUT, SDL.
Diese finden Sie -- einschließlich Dokumentation --
als freie Software im Internet.
\exercise
{
Multiplikationstabelle
}
\exercise
{
Multiplikationstabelle
}
Geben Sie mit Hilfe einer Schleife ein "`Einmaleins"' aus.
\\
Geben Sie mit Hilfe einer Schleife ein "`Einmaleins"' aus.
\\
...
@@ -95,16 +84,6 @@
...
@@ -95,16 +84,6 @@
(
siehe dazu die Dokumentation zu
\lstinline
{
printf
()
}
,
(
siehe dazu die Dokumentation zu
\lstinline
{
printf
()
}
,
z.
\,
B.
\ \,\lstinline
[
style
=
cmd
]
{
man
3
printf
}
\,
)
z.
\,
B.
\ \,\lstinline
[
style
=
cmd
]
{
man
3
printf
}
\,
)
\exercise
{
Fibonacci-Zahlen
}
Die Folge der Fibonacci-Zahlen ist definiert durch:
\begin{quote}
1.
\
Zahl: 0
\\
2.
\
Zahl: 1
\\
nächste Zahl = Summe der beiden vorherigen
\end{quote}
Schreiben Sie ein Programm, das die ersten 50 Fibonacci-Zahlen ausgibt.
\exercise
{
Schaltjahr ermitteln
}
\exercise
{
Schaltjahr ermitteln
}
Schreiben Sie ein Programm, das eine Jahreszahl erfragt
Schreiben Sie ein Programm, das eine Jahreszahl erfragt
...
...
This diff is collapsed.
Click to expand it.
README.md
+
1
−
1
View file @
7728eeec
...
@@ -21,7 +21,7 @@ Vortragsfolien:
...
@@ -21,7 +21,7 @@ Vortragsfolien:
Übungsaufgaben:
Übungsaufgaben:
---------------
---------------
*
[
09.10.2017: Hello
, w
orld
!
, Multiplikationstabelle,
Fibonacci-Zahlen,
Schaltjahr ermitteln
](
https://gitlab.cvh-server.de/pgerwinski/hp/raw/master/20161003/hp-uebung-20171009.pdf
)
*
[
09.10.2017: Hello
-W
orld
-Programme
, Multiplikationstabelle, Schaltjahr ermitteln
](
https://gitlab.cvh-server.de/pgerwinski/hp/raw/master/20161003/hp-uebung-20171009.pdf
)
Skript:
Skript:
-------
-------
...
...
This diff is collapsed.
Click to expand it.
common/pgscript.sty
+
7
−
1
View file @
7728eeec
...
@@ -30,8 +30,9 @@
...
@@ -30,8 +30,9 @@
\usepackage
{
helvet
}
\usepackage
{
helvet
}
\renewcommand*\familydefault
{
\sfdefault
}
\renewcommand*\familydefault
{
\sfdefault
}
\usepackage
{
graphicx
}
\usepackage
{
graphicx
}
\usepackage
{
pstricks
}
\usepackage
{
ifluatex
}
\usepackage
{
ifluatex
}
\usepackage
{
color
}
\usepackage
{
enumerate
}
%% Repair kerning: Automatically insert "\kern{-0.15em}" between "//" % (in URLs).
%% Repair kerning: Automatically insert "\kern{-0.15em}" between "//" % (in URLs).
%% PG20151206: This seems unnecessary here. Maybe due to \sf?
%% PG20151206: This seems unnecessary here. Maybe due to \sf?
...
@@ -77,6 +78,11 @@
...
@@ -77,6 +78,11 @@
\newcommand
{
\arrowitem
}{
\item
[\textarrow]
}
\newcommand
{
\arrowitem
}{
\item
[\textarrow]
}
\newcommand
{
\newterm
}
[1]
{
\emph
{
\color
{
darkgreen
}
#1
}}
\newcommand
{
\newterm
}
[1]
{
\emph
{
\color
{
darkgreen
}
#1
}}
\newcounter
{
exercise
}
\newcommand
{
\exercise
}
[1]
{
\addtocounter
{
exercise
}{
1
}
\subsection*
{
Aufgabe
\arabic
{
exercise
}
: #1
}}
\newcommand
{
\gitfile
}
[3]
{
\href
{
https://gitlab.cvh-server.de/pgerwinski/#1/raw/master/#2/#3
}{
\file
{
#3
}}}
\usepackage
{
listings
}
\usepackage
{
listings
}
\lstset
{
basicstyle=
\color
{
blendedblue
}
,
\lstset
{
basicstyle=
\color
{
blendedblue
}
,
language=C,
language=C,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment