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.

uses crt;
const fo='data.txt';
var f1:text;
a:array[1..10]of integer;
i,n:integer;
begin
clrscr;
assign(f1,fo); rewrite(f1);
n:=10;
for i:=1 to n do readln(a[i]);
for i:=1 to n do write(f1,a[i]:4);
close(f1);
readln;
end.

#include <bits/stdc++.h>
using namespace std;
long long a[10],b[10],i,j;
int main()
{
freopen("input.txt","r",stdin);
freopen("output.txt","w",stdout);
for (i=1; i<=10; i++) cin>>a[i];
for (j=1; j<=10; j++) cin>>b[j];
for (i=1; i<=10; i++)
cout<<a[i]+b[i]<<" ";
return 0;
}

uses crt;
var a:array[1..100]of integer;
i,n,dem1,dem2:integer;
begin
clrscr;
readln(n);
for i:=1 to n do readln(a[i]);
for i:=1 to n do write(a[i]:4);
writeln;
dem1:=0;
for i:=1 to n do
if (a[i]>a[i-1]) and (a[i]>a[i+1]) then dem1:=dem1+1;
dem2:=0;
for i:=1 to n do
if (a[i]<a[i-1]) and (a[i]<a[i+1]) then dem2:=dem2+1;
writeln(dem1);
writeln(dem2);
readln;
end.

Em bài 2 viết thế này thì sai ở những chỗ nào ạ
program bai tap;
uses crt;
var s: string [10]
dem,i: byte
begin
clrscr;
write ('Nhap xau S:')
readln (s);
dem: = 0;
for i: = 1 to length (s) do
if (s[i]: = 'A') or (s[i]: = 'a') or (s[i]: = 'B') then dem: = dem + 1;
writeln (dem);
readln;
end.
Hạ Tâm : sao hai bài bạn yêu cầu là nhập vào xâu .
Lỗi do bạn thiếu ';' Sửa lỗi :
program bai tap;
uses crt;
var s: string [10];
dem,i: byte;
begin
clrscr;
write ('Nhap xau S:');
readln (s);
dem: = 0;
for i: = 1 to length (s) do
if (s[i]: = 'A') or (s[i]: = 'a') or (s[i]: = 'B') then dem: = dem + 1;
writeln (dem);
readln;
end.

uses crt;
var a:array[1..200]of integer;
n,i,k,t,t1:integer;
begin
clrscr;
write('Nhap n='); readln(n);
for i:=1 to n do
begin
write('A[',i,']='); readln(a[i]);
end;
write('Nhap k='); readln(k);
t:=0;
for i:=1 to n do
if a[i] mod 2<>0 then t:=t+a[i];
t1:=0;
for i:=1 to n do
if a[i] mod k=0 then t1:=t1+a[i];
writeln('Tong cac phan tu le la: ',t);
writeln('Tong cac phan tu la boi cua ',k,' la: ',t1);
readln;
end.

#include <bits/stdc++.h>
using namespace std;
long long a[1000],b[1000],i,n,t,dem;
int main()
{
cin>>n;
for (i=1; i<=n; i++) cin>>a[i];
dem=0;
for (i=1; i<=n; i++)
if (a[i]%2!=0)
{
dem++;
b[dem]=a[i];
}
for (i=1; i<=dem; i++) cout<<b[i]<<" ";
cout<<endl;
t=0;
for (i=1; i<=dem; i++) t+=b[i];
cout<<t;
return 0;
}

const fi='bt.inp';
fo='bt.out';
var f1,f2:text;
a:array[1..100]of integer;
i,n,max,min:integer;
begin
assign(f1,fi); reset(f1);
assign(f2,fo); rewrite(f2);
readln(f1,n);
for i:=1 to n do
read(f1,a[i]);
max:=a[1];
min:=a[1];
for i:=1 to n do
begin
if max<a[i] then max:=a[i];
if min>a[i] then min:=a[i];
end;
for i:=1 to n do
if (min<a[i]) and (a[i]<max) then write(f2,a[i]:4);
close(f1);
close(f2);
end.
uses crt;
const finp='nhap.txt';
fout='xuat.txt';
type mang=array[1..10000] of longint;
var f:text;
n:longint;
a:mang;
{-----------------------------------------------------}
procedure doc;
var i:longint;
begin
assign(f,finp);
reset(f);
readln(f,n);
for i:=1 to n do read(f,a[i]);
close(f);
end;
{-----------------------------------------------------------------}
procedure ghi;
begin
assign(f,fout);
rewrite(f);
end;
{--------------------------------------------------------------}
function scp(x:longint):boolean;
begin
if sqr(round(sqrt(x)))=x then scp:=true
else scp:=false;
end;
{-------------------------------------------------------------}
procedure xuly;
var i,k:longint;
b:mang;
begin
for i:=1 to n do write(f,a[i],' ');
writeln(f);
k:=0;
for i:=1 to n do
if i mod 2<>0 then
begin
inc(k);
b[k]:=a[i]+a[i+1];
end;
for i:=1 to k do write(f,b[i],' ');
writeln(f);
for i:=1 to k do
if (b[i]>0) and (scp(b[i])) then write(f,b[i],' ');
end;
{--------------------------------------------------------}
begin
doc;
ghi;
xuly;
close(f);
end.
tuy có chút ko hỉu cho lắm nhưng dù sao vẫn cảm ơn bạn nhìu! <3