CHO XÂU S 1.Đếm xem có bao nhiêu kí tự là chữ số. 2.Đếm xem có bao nhiêu kí tự là chữ cái. 3.Xoá các kí tự trắng. 4.Kiểm tra xâu S có đối xứng không . Giúp e với.
Đề bài: Nhập vào xâu s, có đội dài không quá 100 kí tự
1. Hãy chuẩn hoá xâu S (xoá các kí tự trắng thừa giữa các từ trong xâu, chỉ giữ lại 1)
2. Đếm xem xâu S có bao nhiu từ
3. Đổi tất cả kí tự "a" trong xâu S thành "A"
viết chương trình nhập vào chuỗi S a)Đếm xem trong chuỗi có bao nhiêu kí tự b)xuất ra chuỗi đảo c)xóa kí tự trắng dư thừa trong xâu d) đếm các chữ số trong xâu
mong các bạn giúp mình với.
uses crt;
var s:string;
i,d,dem:integer;
begin
clrscr;
write('Nhap chuoi S:'); readln(s);
d:=length(s);
writeln('Trong chuoi ',s,' co ',d,' ki tu');
writeln('Chuoi dao cua chuoi ',s,' la: ');
for i:=d downto 1 do
write(s[i]:4);
writeln;
dem:=0;
for i:=1 to d do
if s[i] in ['0'..'9'] then inc(dem);
writeln('So chu so trong xau la: ',dem);
readln;
end.
Viết chương trình nhập vào xâu S.a, Xoá hết kí tự là chữ trong xâu.b, đếm xem xâu có bao nhiêu nguyên âm. c, đếm số lần xuất hiện của kí tự k đc nhập bào từ bàn phím
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
if (s[i] in ['a'..'z']) or (s[i] in ['A'..'Z']) then delete(s,i,1);
writeln('Xau sau khi xoa het ki tu chu la: ',s);
readln;
end.
1.Viết hàm cho biết xâu S1 có xuất hiện trong xâu S2 không?
2.Viết hàm chèn câu S1 vào S2 từ vị trí thứ 6?
3. Đếm xem có bao nhiêu kí tự là chữ số trong xâu S2
(Mọi người ơi giúp mình với ạ, mai mình thì rồi)
Hãy viết chương trình nhập vào từ bàn phím xâu kí tự S (không quá 200 kí tự). Sau đó thực hiện các công việc sau:
+ In lại xâu S theo chiều ngược lại.
+ Đếm xem trong xâu S có bao nhiêu từ.
VD: S= ‘Do Minh Thom87’
=> In lại xâu S: ’78mohT hniM oD’
=> Số từ: 3
Mọi người giúp mình với ạ!
Program HOC24;
var S: string;
d,i: byte;
begin
write('S= '); readln(s);
For i:= length(s) downto 1 do write(s[i]);
writeln;
while s[length(s)]=#32 do delete(s,length(s),1);
while pos(#32#32,s)<>0 do delete(s,pos(#32#32,s),1);
while s[1]=#32 do delete(s,1,1);
d:=0;
for i:=1 to length(s) do d:=d+1;
write('So tu :',d);
readln
end.
uses crt;
var s:string[200];
i,d,dem:integer;
begin
clrscr;
write('Nhap xau:'); readln(s);
d:=length(s);
write('Xau viet theo chieu nguoc la: ');
for i:=d downto 1 do
write(st[i]);
writeln;
dem:=0;
for i:=1 to d do
if st[i]=#32 then inc(dem);
writeln('So tu la: ',dem);
readln;
end.
cho xâu kí tự có dộ lớn 105 kí tự bao gồm chứ cái tiếng anh , chứ số và dấu cách viết chương trình đếm số từ có trong xâu s từ là dãy tất cả các chữ cái liên tục độ dài tối đa 1 từ 20 kí tự
#include <bits/stdc++.h>
using namespace std;
int main()
{
string st;
int d,i,dem=0;
getline(cin,st);
d=st.length();
for (int i=0; i<d; i++)
if (st[i]=' ') dem++;
cout<<dem+1;
return 0;
}
Bài 1. Nhập vào xâu S1, hãy đếm số kí tự là chữ cái tiếng Anh (kể cả chữ in thường hay in hoa)? Bài 2. Nhập vào xâu S1, hãy đếm các kí tự không là số, không là chữ cái tiếng Anh trong xâu 51? Bài 3. Nhập vào 1 xâu nhị phân bao gồm các ki tự 0 và 1. Viết chương trình chuyển đổi số nhị phân đó sang số thập phân? Mn giúp m vs, m học python
1.Cho 1 xâu kí tự tính xem trong số đó có bao nhiêu loại kí tự khác nhau (không phân biệt in hoa hay in thường)
2.Viết chương trình nhập 1 mảng n số nguyên. Đếm số phần tử nhỏ hơn 0, đếm số phần tử lớn hơn 0
3.Nhập xâu gồm tất cả chữ và số xuất ra màn hình các số riêng và chữa riêng. Hãy đếm số lần xuất hiện của mỗi chữ mỗi số
"giải giúp e vs 19h 22/7 e nộp r"