Var s,maxs:string; i,max,j,len:integer; begin max:=-1; readln(s); var ars:=s.Split; for i:=0 to ars.length-1 do begin len:=0; for j:=1 to ars[i].length do if (lowcase(ars[i][j])>='a') and (lowcase(ars[i][j])<='z') then inc(len); if ars[i].length=max then maxs+=chr(13)+ars[i]+' '+len; if ars[i].length>max then begin maxs:=ars[i]+' '+len; max:=ars[i].length; end; end; write(maxs); end.
Пример ввода: Steins;Gate is fine VN, 12345678910 Пример вывода: Steins;Gate 10 12345678910 0
//2
Var s:string; i,counter:integer; begin readln(s); for i:=1 to length(s) do if (s[i]=upcase(s[i])) and (lowcase(s[i])>='a') and (lowcase(s[i])<='z') then inc(counter); writeln(counter); end.
#include <iomanip>
using namespace std;
int main() {
int n,k,m;
cout<<"N = "; cin>>n;
cout<<endl;
if (n%2!=0) {
cout<<"недопустимое значение N: "<<n<<endl;
return(1);
}
cout<<setw(12)<<"gooses"<<setw(10)<<"rabbits"<<endl;
m=n/4; k=(n-m*4)/2;
while (m>=0) {
if (k>0) cout<<setw(10)<<k;
else cout<<setw(10)<<"--";
if (m>0) cout<<setw(10)<<m;
else cout<<setw(10)<<"--";
cout<<endl;
m--; k+=2;
}
system("pause");
return(0);
}
//1
Var
s,maxs:string;
i,max,j,len:integer;
begin
max:=-1;
readln(s);
var ars:=s.Split;
for i:=0 to ars.length-1 do
begin
len:=0;
for j:=1 to ars[i].length do
if (lowcase(ars[i][j])>='a') and (lowcase(ars[i][j])<='z') then
inc(len);
if ars[i].length=max then
maxs+=chr(13)+ars[i]+' '+len;
if ars[i].length>max then
begin
maxs:=ars[i]+' '+len;
max:=ars[i].length;
end;
end;
write(maxs);
end.
Пример ввода:
Steins;Gate is fine VN, 12345678910
Пример вывода:
Steins;Gate 10
12345678910 0
//2
Var
s:string;
i,counter:integer;
begin
readln(s);
for i:=1 to length(s) do
if (s[i]=upcase(s[i])) and (lowcase(s[i])>='a') and (lowcase(s[i])<='z') then
inc(counter);
writeln(counter);
end.
Пример ввода:
SiMple TeXt
Пример вывода:
4