#include <iostream>
using namespace std;
int N, summa;
int main()
{
int massiv[10];
cin >> N;
for (int i= 0; i< 10 ; i++)
cin >> a[i] ;
if (a[i] % N == 0)
summa = summa + a[i];
}
cout << summa;
return 0;
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
#include <iostream>
using namespace std;
int N, summa;
int main()
{
int massiv[10];
cin >> N;
for (int i= 0; i< 10 ; i++)
{
cin >> a[i] ;
if (a[i] % N == 0)
summa = summa + a[i];
}
cout << summa;
return 0;
}