Advertisement
Tankado95

Untitled

Apr 15th, 2015
198
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.42 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int check (int a[],int dima, int b[],int dimb){
  4.   int i=0,j;
  5.   int trovato=0;
  6.   while (trovato!=0 && i<dima-1){
  7.     for(j=0;j<dimb;j++){
  8.       if (a[i]==a[j] && a[i+1]==a[j])
  9.       trovato=1;
  10.       }
  11.   i++;
  12.   }
  13. return trovato;
  14. }
  15.  
  16.  
  17. int main() {
  18. int a[10];
  19. int b[15];
  20. int i;
  21. for (i=0; i<10;i++)
  22. scanf("%d",&a[i]);
  23. for (i=0; i<15;i++)
  24. scanf("%d",&b[i]);
  25. check (a, 10, b, 15);
  26.   return 0;
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement