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.
Var a: string;
i, Dem: integer;
Begin
writeln(‘nhap xau:’);
Readln(a);
Dem:=0;
For i:=1 to length(a) do
If a[i] =’ ‘ then
Dem:= Dem+1;
Writeln(Dem);
Readln
End.
uses crt;
var st:string;
i,dem:integer;
begin
clrscr;
readln(st);
writeln(length(st));
for i:=5 to 8 do write(st[i]);
writeln;
dem:=0;
for i:=1 to length(st) do
if st[i]='b' then dem:=dem+1;
writeln(dem);
readln;
end.
uses crt;
var st:string;
i,d,dem:integer;
begin
clrscr;
write('Nhap xau:'); readln(st);
d:=length(st);
dem:=0;
for i:=1 to d do
if st[i]=#32 then inc(dem);
writeln(dem);
readln;
end.
#include <bits/stdc++.h>
using namespace std;
string st;
int d,i;
int main()
{
getline(cin,st);
d=st.length();
for (i=0; i<=d-1; i++) swap(st[i],st[n-1-(i-1)]);
cout<<st;
return 0;
}
#include <bits/stdc++.h>
using namespace std;
string st;
int d,i;
int main()
{
getline(cin,st);
d=st.length();
for (i=0; i<d; i++)
if ((int(st[i])>=48) and (int(st[i])<=57)) cout<<st[i]<<" ";
cout<<endl;
for (i=0; i<=d-1; i++)
if ((int(st[i])>=48) and (int(st[i])<=57)) cout<<i<<" ";
return 0;
}
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 st[i]=#32 then
begin
writeln(i);
break;
end;
readln;
end.