#include main() { char s[]="12345678"; int v[4]={0,1,1,0},k,i; for (k=0; s[k];k++)#includemain(){ char s[]="12345678"; int v[4]={0,1,1,0},k,i;for (k=0; s[k];k++){switch (s[k]){case'1':i=0; case'2':i=1;case'3':i=2; case'4':i=3; }v[i]++; }for(k=0;k

来源:学生作业帮助网 编辑:六六作业网 时间:2024/12/25 08:59:41
#includemain(){chars[]="12345678";intv[4]={0,1,1,0},k,i;for(k=0;s[k];k++)#includemain(){chars[]="123

#include main() { char s[]="12345678"; int v[4]={0,1,1,0},k,i; for (k=0; s[k];k++)#includemain(){ char s[]="12345678"; int v[4]={0,1,1,0},k,i;for (k=0; s[k];k++){switch (s[k]){case'1':i=0; case'2':i=1;case'3':i=2; case'4':i=3; }v[i]++; }for(k=0;k
#include main() { char s[]="12345678"; int v[4]={0,1,1,0},k,i; for (k=0; s[k];k++)
#include
main()
{ char s[]="12345678"; int v[4]={0,1,1,0},k,i;
for (k=0; s[k];k++)
{switch (s[k])
{case'1':i=0; case'2':i=1;
case'3':i=2; case'4':i=3; }
v[i]++;
}
for(k=0;k

#include main() { char s[]="12345678"; int v[4]={0,1,1,0},k,i; for (k=0; s[k];k++)#includemain(){ char s[]="12345678"; int v[4]={0,1,1,0},k,i;for (k=0; s[k];k++){switch (s[k]){case'1':i=0; case'2':i=1;case'3':i=2; case'4':i=3; }v[i]++; }for(k=0;k
k = 0 ==> s[k] = 1 -> 由于没有break -> 执行case后i = 3 -> v[3] = 0 -> ++ -> v[3] = 1
k = 1 -----> v[k] = 2 -> i = 3 -> v[3] = 2
...
...
k = 7 --> s[k] = 8 -> i = 3 --> v[3] = 8;
v[0] = 0,v[1] =1,v[2] = 1,v[3] = 8.