13/09/08 15:39
Mak
Ciao a tutti.
Volevo chiedere se si può fare in modo che un programma, con una variabile string, non riconosca la differenza tra le lettere maiuscole e minuscole? Non so se mi sono spiegato bene...
Ultima modifica effettuata da pierotofy 13/09/08 18:10
aaa
17/09/08 13:48
Anonymous
in teoria dovrebbe venir cosi
prova un pò
program password;
uses Crt;
var st:string[40]; location:integer;
begin
clrscr;
writeln(‘Immettere la password: ‘);
readln(st);
{ convert lower case letters to upper case }
for Location := 1 to Length(St) do
St[Location] := UPCASE(St[Location]);
{ convert upper case letters to lower case }
for Location := 1 to Length(St) do
if St[Location] in['A'..'Z']
then St[Location] := CHR(ORD(St[Location]) + 32);
if st=’pascal’ then
writeln(‘Bravo!’)
else
begin
TextColor(5);
TextBackGround(15);
writeln(‘Sbagliato!’);
end;
readln
end.
Ultima modifica effettuata da Anonymous 17/09/08 13:55
aaa