#include <iostream>
#include <vector>
#include <cmath>
using namespace std;
struct river{
string name;
double length;
double depth;
bool ships;
};
signed main(){
int n;
cin >> n;
river a[n];
for(int i = 0; i < n; i++)
cin >> a[i].name >> a[i].length >> a[i].depth >> a[i].ships;
vector<river> ans;
for(auto i: a)
if(i.length > 2 && i.ships)
ans.push_back(i);
for(auto i: ans){
cout << "name: " << i.name << "\n";
cout << "length: " << i.length << "\n";
cout << "depth: " << i.depth << "\n";
cout << "ships?: Yes";
}
}
#include <iostream>
#include <vector>
#include <cmath>
using namespace std;
struct river{
string name;
double length;
double depth;
bool ships;
};
signed main(){
int n;
cin >> n;
river a[n];
for(int i = 0; i < n; i++)
cin >> a[i].name >> a[i].length >> a[i].depth >> a[i].ships;
vector<river> ans;
for(auto i: a)
if(i.length > 2 && i.ships)
ans.push_back(i);
for(auto i: ans){
cout << "name: " << i.name << "\n";
cout << "length: " << i.length << "\n";
cout << "depth: " << i.depth << "\n";
cout << "ships?: Yes";
}
}
program n_1;
var a, b : string; i, s, n: integer;
begin
n:=0;
repeat
writeln('Введите слово');
readln(a);
s:=length(a);
for i:=1 to s do
begin
if a[i]='' then n:=n+1
end;
if n>=2 then b:=b+' '+a;
writeln('Слово',b);
writeln('Количество букв: ', n);
end.
program abc;
var a:string; z, i, k, l m, n: integer;
begin
k:=0;
l:=0;
m:=0;
n:=0;
writeln('Введите слово');
readln(a);
z:=length(a);
for i:=1 to z do
begin
if a[i]='Щ' then k:=k+1 else
if a[i]='Ц' then l:=l+1 else
if a[i]='Ы' then n:=n+1 else m:=m+1;
end;
writeln('Щ', k, 'Ц', l, 'Ы', n, 'О', m);
end.
это на нахождение двойных букв
program chet;
var a, l: string; s, i: integer;
begin
repeat
writeln('Введите слово');
readln(a);
s:=length(a);
for i:=1 to s do
if a[i]=a[i+1] then l:l+' '+a;
until a>' ';
writeln(l);
end.