Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int diviz(int n, int a[100])
- {
- int c=0;
- for(int i=1; i<n; i++)
- for(int j=i+1; j<=n; j++)
- {
- if(i%j==0 || (i-1)%j==0)
- c++;
- }
- return c;
- }
- int main()
- {
- int n=5;
- int a[100]= {0,4,8,3,9,4};
- cout<<diviz(n,a);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement