pascal nha
Hãy nhập câu hỏi của bạn vào đây, nếu là tài khoản VIP, bạn sẽ được ưu tiên trả lời.
program cho_xuat;
uses
System.SysUtils, System.Classes, System.Generics.Collections;
type
Tsum = record
value: Integer;
end;
TsumArray = array of Tsum;
function cho_xuat(N: String; M: Integer): TsumArray;
begin
SetLength(Result, Length(N));
for i := 0 to High(Result) do
begin
if N[i] >= 58 then
Result[i].value := Result[i].value + M
else
Result[i].value := Result[i].value - M;
end;
end;
var
N, M: String;
a: TsumArray;
begin
readln(N, M);
a := cho_xuat(N, M);
WriteLn('KQ: ' + N, ' -> ' + ConvertIntToString(M) + '');
for i := 0 to High(a) do
begin
WriteLn(' + ', a[i].value, ' +', );
end;
end.
uses crt;
var a,b:int64;
begin
clrscr;
readln(a,b);
writeln((a+b)/3-5*a:4:2);
readln;
end.
Program HOC24;
var st,st1,st2: string;
i: byte;
f: text;
const fi='SPLIT.INP ' ;
fo = 'SPLIT.OUT' ;
Procedure ip;
begin
assign(f,fi);
reset(f);a
read(f,st);
close(f);
end;
Procedure out;
begin
assign(f,fo);
rewrite(f);
st1:=''; st2:='';
for i:=1 to length(st) do
begin
if st[i] in ['A'..'z'] then st1:=st1+st[i];
if st[i] in ['0'..'9'] then st2:=st2+st[i];
end;
writeln(f,st1);
write(f,st2);
close(f);
end;
Begin
ip;
out;
End.
Program GIAINEN;
Var s,st: string;
j,i,k,l: byte;
begin
readln(s);
while length(s)<>0 do
begin
for i:=1 to length(s) do
if s[i] in ['A'..'Z'] then st:=st+s[i]
else if s[i] in ['1'..'9'] then break;
for i:=1 to length(s) do
if s[i] in ['2'..'9'] then
begin
val(s[i],k);
l:=i;
break;
end;
for j:=1 to k do write(st);
delete(s,1,l);
st:='';
end;
readln
end.
program Nenxau;
var s: string;
i, count: integer;
c: char;
begin
readln(s);
count := 1;
c := s[1];
for i := 2 to length(s) do
begin
if s[i] = c then
inc(count)
else
begin
write(count);
write(c);
count := 1;
c := s[i];
end;
end;
write(count);
write(c);
end.
Thu gọn (x+1) ^4 - (x+2) ^5 - ( 1+2x)^3 . Dùng Pascal nha
Câu hỏi tương tự Đọc thêmToán lớp 8
program count_days;
var
a, b, c, x, y, z, days: integer;
function is_leap_year(year: integer): boolean;
begin
if (year mod 4 = 0) and (year mod 100 <> 0) or (year mod 400 = 0) then
is_leap_year := true
else
is_leap_year := false;
end;
function days_in_month(month, year: integer): integer;
begin
case month of
1, 3, 5, 7, 8, 10, 12: days_in_month := 31;
4, 6, 9, 11: days_in_month := 30;
2:
if is_leap_year(year) then
days_in_month := 29
else
days_in_month := 28;
end;
end;
begin
writeln('Nhap ngay a thang b nam c: ');
readln(a, b, c);
writeln('Nhap ngay x thang y cung nam c: ');
readln(x, y, z);
if (a > x) or ((a = x) and (b > y)) or ((a = x) and (b = y) and (c > z)) then
begin
writeln('Loi nhap lieu!');
halt;
end;
days := days_in_month(b, c) - a + 1;
while (b < y) or ((b = y) and (c < z)) do
begin
a := 1;
b := b + 1;
if b > 12 then
begin
b := 1;
c := c + 1;
end;
days := days + days_in_month(b, c);
end;
days := days - (days_in_month(y, z) - x);
writeln('So ngay giua hai ngay la: ', days);
end.
Dữ liệu ra: số ngày tương ứng