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;
}
Объяснение:
#include <iostream>
using namespace std;
int main(){ cout << "Vvedute kol-vo ocenok" << endl;
int n,i,a,Four,Five; n = i = a = Four = Five = 0;
cin >> n;
for (i = 1; i <= n; i++) { cin >> a; if (a == 4){ Four++;} else if (a == 5) { Five++; } } if (Four > Five){ cout << "Four" << endl;} else if (Five > Four) { cout << "Five" << endl; } else { cout << "Equal"<< endl; } cout << "Kol-vo 4: " << Four << " Kol-vo 5: " << Five << endl; return 0;}