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)
Объяснение:
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;
}
Объяснение: