Răspuns :
#include <iostream>
#include <vector>
#include <cassert>
#include <cmath>
#define n_max 100
#define n_min 1
#define max_cifre 9
using namespace std;
template<typename T>
bool VerifiMultiplu(vector<T> vect)
{
for(auto &elem:vect) if(elem:vect[vect.size()-1]) return false;
return true;
}
int main()
{
ifstream fin("date.in");
unsigned short int n;
assert(fin>>n);
assert(n => n_min && n <= n_max);
vector<long long> vect(n);
for(auto &elem:vect)
{
assert(fin>>elem);
assert(elem/pow(10, cifre_max - 1) <= 9)
}
fin.close();
ofstream fout("date.out", ios::trunc);
if(VerifiMultiplu(vect)) fout<<"DA";
else fout<<"NU";
return 0;
}
#include <vector>
#include <cassert>
#include <cmath>
#define n_max 100
#define n_min 1
#define max_cifre 9
using namespace std;
template<typename T>
bool VerifiMultiplu(vector<T> vect)
{
for(auto &elem:vect) if(elem:vect[vect.size()-1]) return false;
return true;
}
int main()
{
ifstream fin("date.in");
unsigned short int n;
assert(fin>>n);
assert(n => n_min && n <= n_max);
vector<long long> vect(n);
for(auto &elem:vect)
{
assert(fin>>elem);
assert(elem/pow(10, cifre_max - 1) <= 9)
}
fin.close();
ofstream fout("date.out", ios::trunc);
if(VerifiMultiplu(vect)) fout<<"DA";
else fout<<"NU";
return 0;
}
#include <iostream>
using namespace std;
int n,a[101],ok=1;
int main()
{
cin >> n;
for(int i=1;i<=n;i++)
cin >> a[i];
for(int i=1;i<n;i++)
if(a[i]%a[n])
ok=0;
if(ok)
cout << "DA";
else
cout << "NU";
return 0;
}
using namespace std;
int n,a[101],ok=1;
int main()
{
cin >> n;
for(int i=1;i<=n;i++)
cin >> a[i];
for(int i=1;i<n;i++)
if(a[i]%a[n])
ok=0;
if(ok)
cout << "DA";
else
cout << "NU";
return 0;
}