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.

2 tháng 4 2021

program HOC24;

var s:tring;

i: byte;

begin

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

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

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.

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. 

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.

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 not(st[i] in ['0'..'9']) then write(st[i]);

readln;

end.

13 tháng 2 2022

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.

13 tháng 2 2022

Làm vậy sẽ thừa 1 kí tự trắng ở đầu tiên trong xâu C bạn nhé. Bạn nên gán c:=''; là OK nhất. Nhưng bài làm bài cũng rất tốt^^, mình chỉ góp ý lỗi sai nhỏ, chúc bạn học tốt ^^.

6 tháng 3 2023

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.

9 tháng 9 2023

thiếu array kìa dmmm mẹ m béoooo

 

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.

17 tháng 4 2023

xau = input('Nhập xâu S in hoa: ')

xau_thuong = xau.lower()

print('Xâu S chữ thường là:', xau_thuong)

#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;

}

#include <bits/stdc++.h>

using namespace std;

string st,a[1000];

int i,d,dem,j;

bool kt;

int main()

{

getline(cin,st);

d=st.length();

a[1]=st[0];

dem=1;

for (i=0; i<=d-1; i++)

{

kt=true;

for (j=1; j<=dem; j++)

if (a[j]==st[i]) kt=false;

if (kt==true) 

{

dem++;

a[dem]=st[i];

}

}

for (i=1; i<=dem; i++) cout<<a[i]<<" ";

return 0;

}