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.

18 tháng 1 2021

Program HOC24;

var s: string;

tg,d,max,i: byte;

code: integer;

begin

write('Nhap xau : '); readln(s);

// cau a

for i:=1 to length(s) do if s[i] in ['a'..'z'] then write(upcase(s[i]));

//------

writeln;

//-cau b

for i:=length(s) downto 1 do if s[i] in ['0'..'9'] then write(s[i]);

//------

writeln;

//---cau c

d:=0;

for i:= 1 to length(s) do

if s[i] in ['0'..'9'] then 

begin

val(s[i],tg,code);

if tg>max then max:=tg;

d:=d+1;

end;

if d=0 then write('Khong co chu so trong day') else write('Chu so lon nhat la : ',max);

readln 

end.

uses crt;

var st,st1:string;

d,i,d1,max,x,y:integer;

begin

clrscr;

write('Nhap xau:'); readln(st);

d:=length(st);

writeln('Day cac ki tu thuong doi sang chu hoa la: ');

for i:=1 to d do 

  if st[i] in ['a'..'z'] then write(upcase(st[i]):4);

st1:='';

for i:=1 to d do 

  if st[i] in ['0'..'9'] then st1:=st1+st[i];

d1:=length(st1);

for i:=d1 downto 1 do 

  write(st1[i]:4);

writeln;

max:=0;

for i:=1 to d1 do 

  begin

val(st1[i],x,y);

if max<x then max:=x;

end;

writeln('Chu so lon nhat trong xau la: ',max);

readln;

end.

16 tháng 4 2023

program ChuyenXauSangChuThuong;
var
  str: string; 
  i: integer; 

begin
  write('Nhap mot xau ky tu: ');
  readln(str); 
  for i := 1 to Length(str) do
    str[i] := LowerCase(str[i]); 
  writeln('Xau ky tu chuyen thanh chu thuong la: ', str); 
end.

3 tháng 3 2021

Chương trình:

program bai_10_chuong_4;

uses crt;

var

s: string[100];

i, dem: integer;

Begin

clrscr;

write('Nhap xau vao:'); readln(s); dem:= 0;

for i:= 1 to length(s) do

if ('0'<=s[i]) and(s[i]<=’9') then dem:=dem+l;

Writeln('Trong xau s co '»dem,' chu so thap phan');

readln;

End.

 

uses crt;

var st:string;

i,d,dem:integer;

begin

clrscr;

write('Nhap xau:'); readln(st);

d:=length(st);

writeln('Xau vua nhap la: ',st);

dem:=0;

for i:=1 to d do 

  if st[i] in ['0'..'9'] then inc(dem);

writeln(dem);

readln;

end.

uses crt;

var a,b,c:string;

i,d1,d2:integer;

begin

clrscr;

write('Nhap xau a:'); readln(a);

write('Nhap xau b:'); readln(b);

d1:=length(a);

d2:=length(b);

writeln('Tong do dai hai xau la: ',d1+d2);

c:=#32;

for i:=1 to d1 do 

  if (a[i] in ['A'..'Z']) or (a[i] in ['a'..'z']) then c:=c+a[i];

for i:=1 to d2 do 

  if b[i] in ['0'..'9'] then c:=c+b[i];

writeln('Xau c la: ',c);

readln;

end.

20 tháng 8 2021

ai đó giúp mình với nhanh lên

 

20 tháng 8 2021

thêm test đây nha:

Dữ liệu : Vào từ từ tệp Suaxau.Inp chứa xâu cần sửa. 

Kết quả:  Ghi vào tệp Suaxau.out xâu đã sửa. 

Ví dụ: 

Suaxau.INP

   Suaxau.OUT

Ta#oi thi hoc sinua#h###nh gioi tin hoj#c

     Toi thi hoc sinh gioi tin hoc

10 tháng 5 2023

Var s,st:string;

i:integer;

Begin

Write('Nhap xau ');readln(s);

For i:=1 to length(s) do

If s[i] in ['0'..'9'] then st:=st+s[i];

Write('Cac ki tu so co trong day la ',st);

Readln

End.

10 tháng 5 2023

giúp em với ạ em cảm ơn nhìuu

uses crt;

var s,s1,s2:string;

i,d:integer;

begin

clrscr;

readln(s);

s1:='';

s2:='';

d:=length(s);

for i:=1 to d do

  begin

if s[i] in ['0'..'9'] then s1:=s1+s[i];

if (s[i] in ['a'..'z']) or (s[i] in ['A'..'Z']) then s2:=s2+s[i];

end;

writeln('Xau chua cac ki tu so la: ',s1);

writeln('Xau chua cac ki tu chu la: ',s2);

readln;

end.

3 tháng 3 2021

Chương trình:program bai_10_chuong_4;uses crt;vars: string[100];i, dem: integer;Beginclrscr;write('Nhap xau vao:'); readln(s); dem:= 0;for i:= 1 to length(s) doif ('0'<=s[i]) and(s[i]<=’9') then dem:=dem+l;Writeln('Trong xau s co '»dem,' chu so thap phan');readln;End.

3 tháng 3 2021

Đề của em là

input:Hie6n3 thi5 chu 73 so61

output :Cac chu so:6357316

             Xau da nhap:Hie6n3 thi5 chu 73 so61

Như vậy mới đúng ạ 

em nhập như trên chỉ ra được số 7 thôi ạ