K
Khách

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 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.

QT
Quoc Tran Anh Le
Giáo viên
23 tháng 8 2023

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])

D
datcoder
CTVVIP
19 tháng 12 2023

Program HOC24;

var s: string;

i,x: byte;

begin

readln(s);

//-----------Câu a

while s[1]=#32 do delete(s,1,1);

while s[length(s)]=#32 do delete(s,length(s),1);

while pos(#32#32,s)<>0 do delete(s,pos(#32#32,1);

writeln(s);

//-------------Câu b

s[1]:=upcase(s[1]);

for i:=1 to length(s) do

if s[i]=#32 upcase(s[i+1]);

writeln(s);

//--------------Câu c

for i:=1 to length(s) do

if s[i]=#32 then x:=i;

for i:=x+1 to length(s) do

write(s[i]);

//---------------------------

readln

end.

19 tháng 12 2021

 

#include <bits/stdc++.h>

using namespace std;

double a,b,c,tb;

int main()

{

cin>>a>>b>>c;

tb=(a+b+c)/3;

cout<<fixed<<setprecision(1)<<tb<<endl;

if (tb>=8) cout<<"Gioi";

else if ((6.5<=tb) and (tb<8)) cout<<"Kha";

else if ((5<=tb) and (tb<=6.5)) cout<<"Trung Binh";

else cout<<"Chua dat";

return 0;

}

24 tháng 12 2021

Em cảm ơn

11 tháng 10 2021

2: 

#include <bits/stdc++.h>

using namespace std;

int main()

{

string st;

int a;

cin>>st;

cin>>a;

cout<<"Xin chao "<<st<<endl;

cout<<"Nam nay "<<st<<" "<<2021-a<<" tuoi";

return 0;

}