Bạn chưa đăng nhập. Vui lòng đăng nhập để hỏi bài

Những câu hỏi liên quan
LA VAN CAU
Xem chi tiết
Khánh Mỹ
Xem chi tiết
Nguyễn Lê Phước Thịnh
21 tháng 4 2021 lúc 19:21

const fi='input.txt'

fo='output.txt'

var f1,f2:text;

st:string[125];

a:array[1..125]of string;

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

begin

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

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

readln(f1,st);

d:=length(st);

dem:=1;

a[1]:=st[1];

for i:=1 to d do

  begin

kt:=0;

for j:=1 to dem do 

  if a[j]=st[i] then kt:=1;

if kt=0 then 

begin

inc(dem);

a[dem]:=st[i];

end;

end;

for i:=1 to dem do 

  begin

dem1:=0;

for j:=1 to d do 

if a[i]=st[j] then inc(dem1);

writeln(f2,a[i],' xuat hien ',dem1,' lan');

end;

close(f1);

close(f2);

end.

nguyen dao
Xem chi tiết
Nguyễn Lê Phước Thịnh
7 tháng 5 2021 lúc 21:09

const fi='vao.inp'

fo='ra.out'

var f1,f2:text;

st:string;

i,d:integer;

begin

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

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

readln(f1,st);

d:=length(st);

for i:=1 to d do 

  if st[i]='a' then delete(st,i,1);

writeln(f2,st);

close(f1);

close(f2);

end.

Yến Hoang Thị Hải
Xem chi tiết
nobody
Xem chi tiết
Nguyễn Lê Phước Thịnh
31 tháng 10 2021 lúc 0:52

#include <iostream>
#include <string>
using namespace std;
int main()
{
    string st;
    int dai,i,kt;
    cout<<"Nhap chuoi:"; getline(cin,st);
    dai=st.length();
    kt=0;
    for (int i=0;i<dai;i++)
        if (st[i]!=st[dai-i-1]) kt=1;
    if (kt==0) cout<<"YES";
    else cout<<"NO";
    return 0;
}

 

U Lan
Xem chi tiết
U Lan
Xem chi tiết
U Lan
Xem chi tiết
U Lan
Xem chi tiết