#include <stdio.h>
main()
{
int k=0;
char c='A';
do
{
switch(c++)
{
case 'A':k++;break;
case 'B':k--;
case 'C':k+=2;break;
case 'D':k=k%2;continue;
case 'E':k=k*10;break;
default:k=k/3;
}
k++;
}while(c<'G');
printf("k=%d",k);
}
运行过程:
//c='A',k=1,c='B',k=2;
//c='B',k=1,k=3,c='C';k=4;
//c='C',k=6,C='D',k=7;
//c='D',k=1;c='E';k=2;
//c='E',k=10;k=11;
运行结果: