AleksandarArkan

R-Controlla ricorsivamente se due array sono uguali

Mar 27th, 2015
212
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.26 KB | None | 0 0
  1. int identici(int *primo, int *secondo,int n){
  2.     if(n>0){
  3.         if(primo[n-1]==secondo[n-1])
  4.             identici(primo,secondo,n-1);
  5.         else
  6.             return 0;
  7.         }
  8.     //caso base
  9.     //allora n e' <=0
  10.     else{
  11.         if(primo[n]==secondo[n])
  12.             return 1;
  13.         else
  14.             return 0;
  15.        
  16.     }
  17. }
Advertisement
Add Comment
Please, Sign In to add comment