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.

25 tháng 7 2021

uses crt;

var s:string;

i,tong,x,code:integer;

f,g:text;

k:boolean;

const fi='XAU.INP';

          fo='XAU.OUT';

begin

k:=false;

assign(f,fi); reset(f);

assign(g,fo); rewrite(g);

readln(f,s);

tong:=0;

for i:=1 to length(s) do

begin

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

begin

k:=true;

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

tong:=tong+x;

x:=0;

cod:=0;

end;

end;

if k=false then writeln(g,'Sai yeu cau')

else

begin

writeln(g,s);

writeln(g,tong);

end;

close(f);

close(g);

end.

uses crt;

var s:string;

i,d,dem,dem1,kt:integer;

begin

clrscr;

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

d:=length(s);

dem:=0;

for i:=1 to d do 

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

writeln('So ki tu la chu so la: ',dem);

dem1:=0;

for i:=1 to d do 

  if (st[i] in ['A'..'Z']) or (st[i] in ['a'..'z']) then inc(dem1);

writeln('So ki tu la chu cai la: ',dem1);

write('Xau sau khi xoa ki tu trang la: ');

for i:=1 to d do 

if st[i]<>#32 then write(st[i]);

writeln;

kt:=0;

for i:=1 to d do 

 if st[i]<>st[d-i+1] then kt:=1;

if kt=0 then writeln('Xau doi xung')

else writeln('Xau khong doi xung');

readln;

end.

uses crt;

var st:string;

i,d,dem:integer;

begin

clrscr;

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

d:=length(st);

dem:=0;

for i:=1 to d do 

  if (st[i] in ['a'..'z']) or (st[i] in ['A'..'Z']) then inc(dem);

writeln(dem);

readln;

end.

28 tháng 4 2021

25 tháng 2 2018

Var a: string;

 i, Dem: integer;

Begin

 writeln(‘nhap xau:’);

 Readln(a);

 Dem:=0;

 For i:=1 to length(a) do

 If (‘a’<=a[i]) and (a[i]<=’z’)

  Dem:= Dem+1;

 Writeln(Dem);

 Readln

End.

20 tháng 8 2019

Var a: string;

  i, Dem: integer;

Begin

 writeln(‘nhap xau:’);

 Readln(a);

 Dem:=0;

 For i:=1 to length(a) do

 If (‘A’<=a[i]) and (a[i]<=’Z’) then

  Dem:= Dem+1;

 Writeln(Dem);

 Readln

End.

31 tháng 3 2021

uses crt;

var s:string;

dem,i,d:integer;

begin

clrscr;

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

d:=length(s);

dem:=0;

for i:=1 to d do 

  if (s[i] in ['A'..'Z']) or (s[i] in ['a'..'z']) then inc(dem);

writeln(dem);

readln;

end.