m0_74541756 2022-10-25 22:49 采纳率: 66.7%
浏览 39

在 8 位数码管上的任意 3 位循环显示以下数值: 0,14,28,42,56,70,84,98,112,126。

如何实现这一步骤(c语言基础不好)
在 8 位数码管上的任意 3 位循环显示标题内容的数字

  • 写回答

1条回答 默认 最新

  • DreamLife. 领域专家: C/C++技术领域 2022-12-21 09:26
    关注
    
    
    ```c
    #include <stdio.h>
    
    int main() {
      int values[] = {0, 14, 28, 42, 56, 70, 84, 98, 112, 126};
      int counter = 0;
    
      while (1) {
        // Display the current value
        printf("%d\n", values[counter]);
        // Increment the counter and wrap around if necessary
        counter = (counter + 1) % 10;
      }
    
      return 0;
    }
    
    
    

    ```

    评论

报告相同问题?

问题事件

  • 创建了问题 10月25日