⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 s程控接线器.c

📁 S接线程序,基于pcm的控制程序
💻 C
字号:
/* s programable rectifier */
#include "stdio.h"  /* head file */
main()     /* main function */
{
  int n=0,i=0;   /* define two vars    */

  int pcm[8]={0,1,2,3,4,5,6,7},pcm1[8]; /* define two arrays */
  printf("the inatialize of the pcm is :\n");
  for(;i<=7;i++)   /* output the message of the input pcm */
    {
       printf("%d,",pcm[i]);
    }
   i=0; /* recorver i value */

  /* get the new value of the output pcm1 */
here:
  
   printf("\n  now,%d time is coming,please enter the way the data to go.",i+1);
   n=(getchar()-48); /* getchar derive asc code ,char  ,so ,need to decrease 48,to */                             /* change to  D */ 
   getchar();          /* derive the \n */
  /* printf("%d,",n); */
   pcm1[n]=pcm[i];     /* message passes cm to go to new output pcm */
   i++;                /* i add 1 */
  /* output the new value of the output pcm */
   if (i>=8)
      {
         printf("\nafter CM ,the new value of the pcm is:\n ");
         for (i=0;i<=7;i++)
             {
                printf("%d,",pcm1[i]);
             }
         exit(0);  /* exit the program */
       }
    goto here;  /*  if i<=9 then jump to the signal here to repeat,until i>=9 */
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -