4:
#include<iostream>
#include<algorithm>
#include<string>
using namespace std;
int main()
{
string num{};
cin>>num;
if(int counter=count(begin(num),end(num),'9') ; counter<=1)
cout<<"Yes"<<endl;
}
else
cout<<"No"<<endl;
return 0;
5:
if(bool test=all_of(begin(num),end(num),[](char a){return atoi(&a)%2==0;}) ; test==1)
Объяснение:
1
#include <iostream>
int a, b;
cin>>a>>b;
int p = (a + b) * 2;
int pl = a * b;
cout<<"Perimetr: "<<p;
cout<<"Ploshad: "<<pl;
2
int l;
float r, d;
cin>>l;
r = l / 2 / 3.14;
d = r * 2;
cout<<"Radius: "<<r;
cout<<"Diametr: "<<d;
3
void Reverse(char *numb)
char help;
int N = 3;
for (int i = 0; i < N / 2; i++)
help = numb[i];
numb[i] = numb[N - 1 - i];
numb[N - 1 - i] = help;
for (int i = 0; i < N; i++)
cout << numb[i];
int main(int argc, char const *argv[])
const int N = 3;
char numb[N];
cin >> numb;
Reverse(numb);
4:
#include<iostream>
#include<algorithm>
#include<string>
using namespace std;
int main()
{
string num{};
cin>>num;
if(int counter=count(begin(num),end(num),'9') ; counter<=1)
{
cout<<"Yes"<<endl;
}
else
{
cout<<"No"<<endl;
}
return 0;
}
5:
#include<iostream>
#include<algorithm>
#include<string>
using namespace std;
int main()
{
string num{};
cin>>num;
if(bool test=all_of(begin(num),end(num),[](char a){return atoi(&a)%2==0;}) ; test==1)
{
cout<<"Yes"<<endl;
}
else
{
cout<<"No"<<endl;
}
return 0;
}
Объяснение:
Объяснение:
1
#include <iostream>
using namespace std;
int main()
{
int a, b;
cin>>a>>b;
int p = (a + b) * 2;
int pl = a * b;
cout<<"Perimetr: "<<p;
cout<<"Ploshad: "<<pl;
}
2
#include <iostream>
using namespace std;
int main()
{
int l;
float r, d;
cin>>l;
r = l / 2 / 3.14;
d = r * 2;
cout<<"Radius: "<<r;
cout<<"Diametr: "<<d;
}
3
#include <iostream>
using namespace std;
void Reverse(char *numb)
{
char help;
int N = 3;
for (int i = 0; i < N / 2; i++)
{
help = numb[i];
numb[i] = numb[N - 1 - i];
numb[N - 1 - i] = help;
}
for (int i = 0; i < N; i++)
cout << numb[i];
}
int main(int argc, char const *argv[])
{
const int N = 3;
char numb[N];
cin >> numb;
Reverse(numb);
}