Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Opdracht_1
Language:
Ada
Assembly
Bash
C#
C++ (gcc)
C++ (clang)
C++ (vc++)
C (gcc)
C (clang)
C (vc)
Client Side
Clojure
Common Lisp
D
Elixir
Erlang
F#
Fortran
Go
Haskell
Java
Javascript
Kotlin
Lua
MySql
Node.js
Ocaml
Octave
Objective-C
Oracle
Pascal
Perl
Php
PostgreSQL
Prolog
Python
Python 3
R
Rust
Ruby
Scala
Scheme
Sql Server
Swift
Tcl
Visual Basic
Layout:
Vertical
Horizontal
//fpc 3.0.0 program Opdracht_1; var winst : integer; bezit : integer; dagen : integer; vandaag : integer; morgen : integer; begin winst := 0; bezit :=0; readln(dagen); readln(vandaag); while(dagen>1) do begin readln(morgen); if (bezit = 0) then begin if (vandaag<morgen) then begin winst := winst-vandaag; bezit := 1 end else begin end; end else begin if (vandaag>morgen) then begin winst := winst+vandaag; bezit := 0; end else begin end; end; vandaag := morgen; dagen := dagen - 1; end; if (bezit>0) then begin winst := winst+vandaag; bezit := 0; end else begin end; writeln(winst); end.
3 1 10 3
Show compiler warnings
[
-
]
Show input
edit mode
|
history
|
discussion