Advertisement
skb50bd

CSE-105 Final. Ques-5 Spring'15

May 4th, 2015
273
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.41 KB | None | 0 0
  1. #include<stdio.h>
  2. int main()
  3. {
  4.     int n, m, i, j, c=0;
  5.     scanf("%d %d", &n, &m);
  6.     int a[100]={0};
  7.  
  8. X:
  9.     for(i=0 ; i<n ; i++)
  10.         if(a[i]==0)
  11.         {
  12.             c++;
  13.             if(c==5)
  14.             {
  15.                 a[i]=1;
  16.                 printf("%d ",i+1);
  17.                 c=1;
  18.             }
  19.         }
  20.     for(i=0 ; i<n ; i++)
  21.         if(a[i]==1)
  22.             goto X;
  23.     return 0;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement