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.

#include <bits/stdc++.h>

using namespace std;

string st,st1,st2;

int d,i;

int main()

{

getline(cin,st);

d=st.length();

st1="";

st2="";

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

{

if (48<=st[i] && st[i]<=57) st1+=st[i];

else st2+=st[i];

}

cout<<st1<<st2;

return 0;

}

20 tháng 8 2021

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

 

20 tháng 8 2021

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

uses crt;

var s:string;

i,d:integer;

begin

clrscr;

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

d:=length(s);

for i:=1 to d do 

  s[i]:=upcase(s[i]);

writeln(s);

readln;

end.

3 tháng 3 2021

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.

3 tháng 3 2021

Đề của em là

input:Hie6n3 thi5 chu 73 so61

output :Cac chu so:6357316

             Xau da nhap:Hie6n3 thi5 chu 73 so61

Như vậy mới đúng ạ 

em nhập như trên chỉ ra được số 7 thôi ạ

 

uses crt;

var s,s1,s2:string;

i,d:integer;

begin

clrscr;

readln(s);

s1:='';

s2:='';

d:=length(s);

for i:=1 to d do

  begin

if s[i] in ['0'..'9'] then s1:=s1+s[i];

if (s[i] in ['a'..'z']) or (s[i] in ['A'..'Z']) then s2:=s2+s[i];

end;

writeln('Xau chua cac ki tu so la: ',s1);

writeln('Xau chua cac ki tu chu la: ',s2);

readln;

end.

3 tháng 3 2021

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.

 

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.

8 tháng 5 2019

uses crt;
var ch,d:char;
    i,max:integer;
    s:string;
    a:array['A'..'Z']of integer;
begin
write('nhap xau:');readln(s);
for ch:='A'to'Z' do a[ch]:=0;
for i:=1 to length(s) do begin
s[i]:=upcase(s[i]);
a[s[i]]:=a[s[i]]+1;
end;
max:=a['A'];
for ch:='A'to'Z' do
if a[ch]>max then begin
max:=a[ch];
d:=ch;
end;
writeln('ki tu ',d,' xuat hien nhieu nhat:',max);
readln
end.

8 tháng 5 2019

program xoa_ky_tu;
uses crt;
var x,y:string;
    i,j,dem,max: integer;
    a:char;
BEGIN
clrscr;
write('nhap xau x : ');
readln(x);
y:=x;

for i:=1 to length(x) do
begin
j:=i+1;
repeat
if x[i]=x[j] then delete(x,j,1)
else
j:=j+1;
until (j>length(x));
end;
writeln('xau sau khi loai bo ki tu giong nhau la :',x);

max:=0;
a:=' ';
for i:=1 to length(x) do
begin
dem:=0;
for j:=1 to length(y) do
if x[i]=y[j] then
dem:=dem+1;
if dem>max then
begin
max:=dem;

a:=x[i];
end;
end;
writeln('ki tu ',a,' xuat hien ',max,' lan');

readln;
end.

3 tháng 3 2021

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.

 

uses crt;

var st:string[100];

i,d,kt:integer;

begin

clrscr;

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

kt:=0;

for i:=1 to length(st) do

if st[i]<>st[length(st)-i+1] then kt:=1;

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

else writeln('Xau khong doi xung');

readln;

end.