Advertisement
daniele2013

fusione senza pari

Sep 10th, 2013
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. int fusionesenzapari(int a[ml], int b[ml], int c[ml], int n, int m){
  2. int i, j;
  3. for(i=0;i<n&&i<m;i++){
  4. if(a[i]%2)
  5. c[k++]=a[i];
  6. if(b[i]%2)
  7. c[k++]=b[i];
  8. }
  9. if(i<n)
  10. for(j=i;j<n;j++)
  11. if(a[j]%2)
  12. c[k++]=a[j];
  13. if(i<m)
  14. for(j=i;j<m;j++)
  15. if(b[j]%2)
  16. c[k++]=b[j];
  17. return k;
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement