Những câu hỏi liên quan
Nguyễn TRƯỜNG Giang
Xem chi tiết
Nguyễn Lê Phước Thịnh
4 tháng 4 2022 lúc 21:46

uses crt;

var st:string;

begin

clrscr;

readln(st);

delete(st,3,5);

writeln(st);

readln;

end.

Bình luận (0)
ᝰᦔꫀꪑꪮꪀ
Xem chi tiết
Nguyễn Lê Phước Thịnh
1 tháng 5 2021 lúc 19:25

Câu 1: 

uses crt;

var st:string;

d,i,dem:integer;

begin

clrscr;

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

d:=length(st);

write('Xau sau khi xoa so la: ');

for i:=1 to d do 

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

writeln;

dem:=0;

for i:=1 to d do 

  if st[i]=#32 then inc(dem);

writeln('Xau co ',dem,' dau cach');

writeln('Do dai cua xau la: ',d);

readln;

end. 

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

Câu 2: 

uses crt;

const fi='kq.out'

var st1,st2:string;

f1:text;

begin

clrscr;

write('Nhap xau thu 1:'); readln(st1);

write('Nhap xau thu 2:'); readln(st2);

assign(f1,fi); rewrite(f1);

if length(st2)>length(st1) then writeln(f1,st2)

else writeln(f1,st1);

close(f1);

end.

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

Câu 3: 

uses crt;

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

i,n,t,dem:integer;

begin

clrscr;

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

for i:=1 to n do 

  begin

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

end;

t:=0;

dem:=0;

for i:=1 to n do 

  if a[i] mod 2=0 then

begin

t:=t+a[i];

inc(dem);

end;

writeln('Trung binh cong cac so chan la: ',t/dem:4:2);

readln;

end.

Bình luận (0)
B2_Đinh Thị Huệ
Xem chi tiết
Nguyễn Lê Phước Thịnh
10 tháng 5 2022 lúc 23:02

uses crt;

var st:string;

d,i:integer;

begin

clrscr;

readln(st);

d:=length(st);

for i:=1 to d do 

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

readln;

end.

Bình luận (0)
Phấn Nguyen
Xem chi tiết
Phấn Nguyen
7 tháng 3 2021 lúc 13:46

Giải giúp mk vói🥰

Bình luận (0)
Phước Thiện Lê Hoàng
Xem chi tiết
Nguyễn Lê Phước Thịnh
22 tháng 4 2021 lúc 21:27

1:

uses crt;

const fi='ketqua.txt'

var f1:text;

st:string;

i,d:integer;

begin

clrscr;

assign(f1,fi); rewrite(f1);

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

d:=length(st);

for i:=1 to d do 

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

writeln(f1,st);

close(f1);

end.

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

2:

uses crt;

var a,b,c,d:integer;

{----------chuong-trinh-con-----------------------}

function min(x,y:integer):integer;

begin

if x<y then min:=x

else min:=y;

end;

{---------------chuong-trinh-chinh--------------------}

begin

clrscr;

write('a='); readln(a);

write('b='); readln(b);

write('c='); readln(c);

write('d='); readln(d);

writeln(min(a,min(b,min(c,d))));

readln;

end.

Bình luận (1)
Nguyễn Thị Diễm Hạnh
Xem chi tiết
Minh Lệ
23 tháng 3 2023 lúc 12:13

Program HOC24;

var i,d: byte;

s: string;

begin

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

d:=0;

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

write('Co ',d,' ki tu so trong xau');

readln

end.

Bình luận (0)
Vương Thế Tài
Xem chi tiết
Nguyễn Lê Phước Thịnh
18 tháng 1 2022 lúc 10:10

#include <bits/stdc++.h>

using namespace std;

string st1,st2;

int d1,d2;

int main()

{

cin>>st1>>st2;

d1=st1.length();

d2=st2.length();

if (d1<d2) cout<<st1;

else cout<<st2;

return 0;

}

Bình luận (0)
Bee Lee
Xem chi tiết
Minh An
18 tháng 7 2023 lúc 10:49

st = str(input())

Bình luận (0)
Ngọc Ánh Phùng
Xem chi tiết
Minh Lệ
6 tháng 3 2023 lúc 23:42

Program HOC24;

var s: string;

i: byte;

begin

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

for i:=1 to length(s) do if (s[i]<>#32) and (s[i] in 'A'..'z') then 

begin

upcase(s[i]); write(s[i]);

end;

readln

end.

Bình luận (1)