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.
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.
uses crt;
var st:string;
i,d:integer;
begin
clrscr;
write('Nhap xau:'); readln(st);
d:=length(st);
writeln('Xau vua nhap la: ',st);
for i:=1 to d do
if st[i] in ['a'..'z'] then upcase(st[i]);
writeln(st);
readln;
end.
tk
uses crt;
var st1:string;
i,d:integer;
begin
clrscr;
write('Nhap xau:'); readln(st1);
d:=length(st1);
for i:=1 to d do
if (st1[i]='a') and (st1[i+1]='b') and (st1[i+2]='c') then delete(st1,i,3);
writeln(st1);
readln;
end.
Use crt;
Var S : String;
P: longint;
Begin
Write('Nhap s: '); readln (S);
For P:=length(S) downto 1 do
Write(P);
Readln;
End.
uses crt;
var st:string;
i,d:integer;
begin
clrscr;
write('Nhap xau:'); readln(st);
d:=length(st);
writeln('Xau ban vua nhap la: ',st);
writeln('Xau nguoc la: ');
for i:=d downto 1 do
write(st[i]:4);
readln;
end.
uses crt;
var st1:string;
i,d:integer;
begin
clrscr;
write('Nhap xau:'); readln(st1);
d:=length(st1);
for i:=1 to d do
if (st1[i]='a') and (st1[i+1]='b') and (st1[i+2]='c') then delete(st1,i,3);
writeln(st1);
readln;
end.
#include <bits/stdc++.h>
using namespace std;
string st;
char ktu;
int dem,i,d;
int main()
{
getline(cin,st);
cin>>ktu;
d=st.length();
dem=0;
for (i=0; i<=d-1; i++)
if (st[i]==ktu) dem++;
cout<<dem;
return 0;
}
uses crt;
var s:string;
i,d,dem1,dem2,dem3,dem4:integer;
begin
clrscr;
write('Nhap xau s:'); readln(s);
d:=length(s);
dem1:=0;
dem2:=0;
dem3:=0;
dem4:=0;
for i:=1 to d do
begin
if st[i] in ['0'..'9'] then inc(dem1)
else if st[i] in ['a'..'z'] then inc(dem2)
else if st[i] in ['A'..'Z'] then inc(dem3)
else inc(dem4);
end;
writeln('So luong ky tu so la: ',dem1);
writeln('So luong ky tu thuong la: ',dem2);
writeln('So luong ky tu hoa la: ',dem3);
writeln('So luong ky tu dac biet la: ',dem4);
readln;
end.