Advertisement
Guest User

guwno

a guest
Nov 12th, 2019
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.43 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int main() {
  4.  
  5.     int n;
  6.  
  7.     printf("Podaj liczbe zestawow: \n");
  8.     scanf("%d", &n);
  9.  
  10.     int tab[n];
  11.  
  12.  
  13.     for(int each=0;each<n;++each){
  14.         printf("Podaj liczbe: \n");
  15.         scanf("%d", &tab[each]);
  16.  
  17.     }
  18.  
  19.     for(int i=0;i<n;++i){
  20.         if(tab[i]>0){
  21.             printf("%d ", 1);
  22.         }
  23.         else{
  24.             printf("%d ", 0);
  25.         }
  26.     }
  27.  
  28.  
  29.  
  30.  
  31.     return 0;
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement