-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDNI_letra.f
86 lines (84 loc) · 2.73 KB
/
DNI_letra.f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
Program NUMDNI
implicit integer (a-z)
integer num,resto
character*1 lletra
WRITE(*,*)"...................................................."
WRITE(*,*)"Hola, escribe tu DNI y te dare tu NIF"
WRITE(*,*)"...................................................."
READ(*,*)num
WRITE(*,*)"...................................................."
WRITE(*,*)"...................................................."
RESTO=MOD(num,23)
if (resto.eq.0) then
WRITE(*,*)"TU NIF ES",NUM,"- T"
lletra="T"
else if (resto.eq.1) then
WRITE(*,*)"TU NIF ES",NUM,"- R"
lletra="R"
else if (resto.eq.2) then
WRITE(*,*)"TU NIF ES",NUM,"- W"
lletra="W"
else if (resto.eq.3) then
WRITE(*,*)"TU NIF ES",NUM,"- A"
lletra="A"
else if (resto.eq.4) then
WRITE(*,*)"TU NIF ES",NUM,"- G"
lletra="G"
else if (resto.eq.5) then
WRITE(*,*)"TU NIF ES",NUM,"- M"
lletra="M"
else if (resto.eq.6) then
WRITE(*,*)"TU NIF ES",NUM,"- Y"
lletra="Y"
else if (resto.eq.7) then
WRITE(*,*)"TU NIF ES",NUM,"- F"
lletra="F"
else if (resto.eq.8) then
WRITE(*,*)"TU NIF ES",NUM,"- P"
lletra="P"
else if (resto.eq.9) then
WRITE(*,*)"TU NIF ES",NUM,"- D"
lletra="D"
else if (resto.eq.10) then
WRITE(*,*)"TU NIF ES",NUM,"- X"
lletra="X"
else if (resto.eq.11) then
WRITE(*,*)"TU NIF ES",NUM,"- B"
lletra="B"
else if (resto.eq.12) then
WRITE(*,*)"TU NIF ES",NUM,"- N"
lletra="N"
else if (resto.eq.13) then
WRITE(*,*)"TU NIF ES",NUM,"- J"
lletra="J"
else if (resto.eq.14) then
WRITE(*,*)"TU NIF ES",NUM,"- Z"
lletra="Z"
else if (resto.eq.15) then
WRITE(*,*)"TU NIF ES",NUM,"- S"
lletra="S"
else if (resto.eq.16) then
WRITE(*,*)"TU NIF ES",NUM,"- Q"
lletra="Q"
else if (resto.eq.17) then
WRITE(*,*)"TU NIF ES",NUM,"- V"
lletra="V"
else if (resto.eq.18) then
WRITE(*,*)"TU NIF ES",NUM,"- H"
lletra="H"
else if (resto.eq.19) then
WRITE(*,*)"TU NIF ES",NUM,"- L"
lletra="L"
else if (resto.eq.20) then
WRITE(*,*)"TU NIF ES",NUM,"- C"
lletra="C"
else if (resto.eq.21) then
WRITE(*,*)"TU NIF ES",NUM,"- K"
lletra="K"
else if (resto.eq.22) then
WRITE(*,*)"TU NIF ES",NUM,"- E"
lletra="E"
endif
WRITE(*,*)"...................................................."
WRITE(*,*)"...................................................."
END