Advertisement
STANAANDREY

pclab3 5

Oct 12th, 2022
627
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.27 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4.   int n, m;
  5.   printf("n="); scanf("%d", &n);
  6.   printf("m="); scanf("%d", &m);
  7.   for (int i = 1, j = 0; i <= n; i++) {
  8.     printf("%d ", j);
  9.     j++;
  10.     if (j == m + 1) {
  11.       j = 0;
  12.     }
  13.   }
  14.   puts("");
  15.   return 0;
  16. }
  17.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement