Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- const int dimA = 7;
- const int dimB = 2;
- const int dimC = 2;
- int divisione(int a[dimA], int b[dimB])
- {
- for(int i = 0; i <= dimA; i++)
- {
- for(int j = 0; j <= dimB; j++)
- {
- if(a[i] % b[j] != 0 && a[i] % b[j+1] != 0)
- {
- cout << a[i] <<"\n";
- }
- } }
- return 0;
- }
- int main()
- {
- int a[dimA] = {2,45,37,21,6,34,35};
- int b[dimB] = {2,3};
- divisione(a,b);
- return 0;
- }
- -----------------------------------------------------------------
- L'OUTPUT È:
- -----------------------------------------------------------------
- 37
- 37
- 37
- 21
- 35
- 35
- 35
- Perchè stampa anche 21?? E perchè ripete i numeri?
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement