Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
PROG-material-public
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Yue Wu
PROG-material-public
Commits
d6d88d98
Commit
d6d88d98
authored
1 year ago
by
dali662d
Browse files
Options
Downloads
Patches
Plain Diff
Upload New File
parent
c24c0234
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Sonderuebung/WiSe23-24/SU04_2023_11_15/02_schaltjahre.f95
+43
-0
43 additions, 0 deletions
Sonderuebung/WiSe23-24/SU04_2023_11_15/02_schaltjahre.f95
with
43 additions
and
0 deletions
Sonderuebung/WiSe23-24/SU04_2023_11_15/02_schaltjahre.f95
0 → 100644
+
43
−
0
View file @
d6d88d98
program
schaltjahre
implicit
none
integer
::
start
,
ende
,
i
write
(
*
,
*
)
"Es werden alle Schlatjahre innerhalb von einem Intervall berechnet."
write
(
*
,
*
)
"Gebe die Ober- und Untergrenze an!"
do
!test ob eingegbene daten korrekt
read
(
*
,
*
)
start
,
ende
if
(
start
<=
ende
.and.
start
>=
0
)
then
if
(
ende
-
start
<=
2000
)
then
!begrenzung länge des intervalls
exit
else
write
(
*
,
*
)
"Fehler: Das Intervall ist zu groß. Bitte max. 2000 Jahre lang."
end
if
else
write
(
*
,
*
)
"Fehler: Untergrenze ist groesser als Obergrenze oder Grenzen sind negativ."
end
if
write
(
*
,
*
)
"Gib die Unter- und Obergrenze erneut ein!"
end
do
! berechne erstes potenzielles schaltjahr (teilbar durch 4)
start
=
start
+
4
-
MOD
(
start
,
4
)
if
(
start
<=
ende
)
then
write
(
*
,
*
)
"Die folgenden Jahre sind Schaltjahre:"
! Teste alle potenziellen Schaltjahre im Intervall
do
i
=
start
,
ende
,
4
! wegen step=4 sind alle i durch 4 teilbar
if
(
.NOT.
MOD
(
i
,
100
)
==
0
.OR.
MOD
(
i
,
400
)
==
0
)
then
! nicht durch 100 teilbar oder durch 400 teilbar
write
(
*
,
*
)
i
end
if
end
do
else
write
(
*
,
*
)
"Es gibt keine Schaltjahre im gegebenen Intervall."
end
if
end
program
schaltjahre
\ No newline at end of file
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