Những câu hỏi liên quan
Khánh Mỹ
Xem chi tiết
SukhoiSu-35
3 tháng 3 2021 lúc 14:53

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.

 

Bình luận (0)
Nguyễn Lê Phước Thịnh
3 tháng 3 2021 lúc 19:46

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.

Bình luận (0)
Khánh Mỹ
Xem chi tiết
Dương Ngọc Nguyễn
3 tháng 3 2021 lúc 14:27

Use crt;

Var S : String;

P: longint;

Begin

Write('Nhap s: '); readln (S);

For P:=length(S) downto 1 do

Write(P);

Readln;

End.

Bình luận (0)
Nguyễn Lê Phước Thịnh
3 tháng 3 2021 lúc 19:44

uses crt;

var st:string;

i,d:integer;

begin

clrscr;

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

d:=length(st);

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

writeln('Xau nguoc la: ');

for i:=d downto 1 do

write(st[i]:4);

readln;

end.

Bình luận (0)
Khánh Mỹ
Xem chi tiết
Nguyễn Lê Phước Thịnh
3 tháng 3 2021 lúc 19:45

uses crt;

var st:string;

i,d:integer;

begin

clrscr;

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

d:=length(st);

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

for i:=1 to d do 

  if st[i]=#32 then delete(st,i,1);

writeln('Xau moi la: ',st);

readln;

end.

Bình luận (0)
Nguyễn Hạnh
Xem chi tiết
Nguyễn Lê Phước Thịnh
2 tháng 4 2021 lúc 19:21

uses crt;

var s:string;

i,d,dem1,dem2,dem3,dem4:integer;

begin

clrscr;

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

d:=length(s);

dem1:=0;

dem2:=0;

dem3:=0;

dem4:=0;

for i:=1 to d do 

  begin

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

else if st[i] in ['a'..'z'] then inc(dem2)

else if st[i] in ['A'..'Z'] then inc(dem3)

else inc(dem4);

end;

writeln('So luong ky tu so la: ',dem1);

writeln('So luong ky tu thuong la: ',dem2);

writeln('So luong ky tu hoa la: ',dem3);

writeln('So luong ky tu dac biet la: ',dem4);

readln;

end.

Bình luận (0)
Đinh Đức Quảng
Xem chi tiết
Nguyễn Lê Phước Thịnh
7 tháng 5 2021 lúc 22:32

uses crt;

var st:string;

begin

clrscr;

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

writeln(length(st));

readln;

end.

Bình luận (0)
Khánh Mỹ
Xem chi tiết
Trần Mạnh
3 tháng 3 2021 lúc 17:23

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.

Bình luận (1)
Nguyễn Lê Phước Thịnh
3 tháng 3 2021 lúc 19:44

uses crt;

var st:string;

i,d:integer;

begin

clrscr;

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

d:=length(st);

for i:=1 to d do 

  if st[i] in ['0'..'9'] then write(st[i]:4);

readln;

end.

Bình luận (0)
Phan thị lê na
Xem chi tiết
Nguyễn Lê Phước Thịnh
6 tháng 4 2021 lúc 12:40

1:

uses crt;

var a:array[1..100]of integer;

i,n,t:integer;

begin

clrscr;

write('Nhap n='); readln(n);

for i:=1 to n do 

  begin

write('A[',i,']='); readln(a[i]);

end;

t:=0;

for i:=1 to n do 

  if a[i] mod 2<>0 then t:=t+a[i];

writeln(t);

readln;

end.

Bình luận (0)
Nguyễn Lê Phước Thịnh
6 tháng 4 2021 lúc 12:42

3:

const fi='dl.txt'

fo='kq.txt'

var f1,f2:text;

a:integer;

begin

assign(f1,fi); reset(f1);

assign(f2,fo); rewrite(f2);

readln(f1,a);

writeln(f2,a);

close(f1);

close(f2);

end.

Bình luận (0)
Nguyễn Lê Phước Thịnh
6 tháng 4 2021 lúc 12:41

2:

uses crt;

var st:string;

d:integer;

begin

clrscr;

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

d:=length(st);

while st[1]=#32 do 

  begin

delete(st,1,1);

d:=length(st);

end;

while st[d]=#32 do 

  begin

delete(st,d,1);

d:=length(st);

end;

writeln(st);

readln;

end.

Bình luận (0)
Harunastu
Xem chi tiết
Minh Lệ
18 tháng 1 2021 lúc 19:40

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.

Bình luận (1)
Nguyễn Lê Phước Thịnh
18 tháng 1 2021 lúc 21:32

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.

Bình luận (1)
phuoc
Xem chi tiết
phuoc
20 tháng 8 2021 lúc 15:03

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

 

Bình luận (2)
phuoc
20 tháng 8 2021 lúc 15:06

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

Bình luận (0)
Melozing
23 tháng 8 2021 lúc 20:16

https://youtu.be/b5YcStwxIiM

Bình luận (2)