[Tin 8] Viết chương trình bằng Pascal

O

one_day

S

syphuongcuong3

1
PHP:
uses crt;
var A: array[word] of integer;
      i,n: integer;
begin
clrscr;
writeln('Nhap gioi han day'); readln(n)
writeln('Nhap tat ca phan tu cua day'); for i:=1 to n do readln(A[i]);
write('Cac so chan:');
for i:=1 to n do 
if A[i] mod 2= 0 then write(A[i]);
write('Cac so le:');
for i:=1 to n do 
if A[i] mod 2!= then write(A[i]);
realn
end.
2
PHP:
USES crt;
VAR st: STRING;
FUNCTION ToUpper(s : STRING) : STRING;
VAR i : BYTE;
BEGIN
FOR i:=1 TO Length(s) DO
s[i] := Upcase(s[i]);
ToUpper := s;
END;      
BEGIN
    clrscr;        
    write('Hay nhap xau...')
    readln(st);
    write('Ket qua',ToUpper(st));
    readln;
END.
 
Top Bottom