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 HOC24;
var i,n: integer;
c: array[1..1000] of integer;
f: text;
begin
assign(f,'MANG3.TXT');
reset(f);
readln(f,n);
for i:=1 to n do read(f,c[i]);
close(f);
for i:=1 to n do if c[i] mod 2=1 then write(c[i],' ');
readln
end.
with open('XAU.INP', 'r') as input_file, open('XAU.OUT', 'w') as output_file:
for line in input_file:
length = len(line.strip())
output_file.write(f'{length}\n')
Bài 3:
uses crt;
const fi='teptong.txt';
var a,b:integer;
f1:text;
begin
clrscr;
assign(f1,fi); rewrite(f1);
readln(a,b);
writeln(a+b);
writeln(f1,a+b);
close(f1);
readln;
end.
ds=list(map(str,input().split()))
c={}
for i in ds:
if i in c:
c[i] =c[i]+1
else:
c[i] = 1
print('số tên khác nhau là',len(c))
print('mỗi tên có số lần xuất hiện là:')
for i in c:
print(i, c[i])
uses crt;
const fi='lop11a1.txt';
var f1:text;
st:array[1..255]of string;
n,i,dem,d,j,dem1,kq:integer;
a:shortstring;
b:array[1..1000]of integer;
begin
clrscr;
assign(f1,fi); rewrite(f1);
write('Nhap so ban trong Group:'); readln(n);
for i:=1 to n do
begin
write('Ban thu ',i,' ten:'); readln(st[i]);
end;
writeln(f1,'Danh sach cac ban trong Group la: ');
for i:=1 to n do
writeln(f1,'Ban thu ',i,' ten la: ',st[i]);
dem:=0;
for i:=1 to n do
begin
a:=st[i];
d:=length(a);
dem1:=0;
for j:=1 to d do
if a[j]=' ' then dem1:=dem1+1;
begin
inc(dem);
b[dem]:=dem1+1;
end;
end;
kq:=0;
for i:=1 to dem do
kq:=kq+b[i];
writeln(f1,'So tu trong day ten vua nhap la: ',kq);
close(f1);
readln;
end.