Advertisement
rdsedmundo

[OBI] sapo.c

May 31st, 2013
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.45 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int main() {
  4.     int nPed, nSap, i, j;
  5.  
  6.     scanf("%d %d", &nPed, &nSap);
  7.  
  8.     int Sapo[nSap][2];
  9.  
  10.     for(i = 0; i < nSap; i++) scanf("%d %d", &Sapo[i][0], &Sapo[i][1]);
  11.  
  12.     for(i = 1; i <= nPed; i++) {
  13.         int OK = 0;
  14.         for(j = 0; j < nSap; j++) {
  15.             int Pos=Sapo[j][0], Salto=Sapo[j][1];
  16.  
  17.             if((Pos-i) % Salto == 0) OK = 1;
  18.         }
  19.         printf("%d\n", OK);
  20.     }
  21.  
  22.     return 0;
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement