qfedu-c-level/day7/d8.c

19 lines
302 B
C

#include <stdio.h>
void watch_n(int i)
{
// 监听 watch_n 函数每调 10 次,打印 i 的结果
static int cnt;
if (++cnt % 10 == 0)
{
printf("%d ", i);
}
}
int main(int argc, char const *argv[])
{
for (int i = 0; i < 100; i++)
watch_n(i);
return 0;
}