Advertisement
Wolfrost

C Esercizio for #2

May 1st, 2016
285
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <stdlib.h>
  2. #include <stdio.h>
  3.  
  4. main()
  5. {
  6.     int v[5], w[5], i, j;
  7.    
  8.     printf("v:\n");
  9.     for (i=0; i<5; i++) scanf("%d",&v[i]);
  10.    
  11.     printf("w:\n");
  12.     for (i=0; i<5; i++) scanf("%d",&w[i]);
  13.    
  14.     for (i=0; i<5; i++)
  15.     {
  16.         for (j=0; j<5; j++)
  17.         {
  18.             if (v[i]>w[j])
  19.             {
  20.                 if ((v[i]%w[j])%2!=0)
  21.                     printf("v[%d]=%d e w[%d]=%d\n",i,v[i],j,w[j]);
  22.             }
  23.         }
  24.     }
  25.    
  26.     system("PAUSE");
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement