jawaban-toki/06. Perulangan/Pola1.c

20 lines
228 B
C
Raw Normal View History

2020-04-10 05:39:17 +00:00
#include <stdio.h>
int main () {
int i,j;
int n,k;
scanf("%d %d",&n,&k);
for(i=1;i<=n;i++) {
if (i>1) {
printf(" ");
}
if (i % k == 0) {
printf("*");
}
else {
printf("%d", i);
}
}
printf("\n");
}