有以下程序#include [stdio.h] void main(){ char *s= "120119110"; int n0,n1,n2,nn,i; n0=n1=n2=nn=i=0; do{ switch(s[i++]){ default : nn++; case '0': n0++; case '1': n1++; case '2': n2++; } }while(s[i]); printf("n0=%d,n1=%d,n2=%d,nn=%d\n",n0,n1,n2,nn); }程序的运行结果是( )。[/i]
A: n0=3,n1=8,n2=9,nn=1
B: n0=2,n1=5,n2=1,nn=1
C: n0=2,n1=7,n2=10,nn=1
D: n0=4,n1=8,n2=9,nn=1
A: n0=3,n1=8,n2=9,nn=1
B: n0=2,n1=5,n2=1,nn=1
C: n0=2,n1=7,n2=10,nn=1
D: n0=4,n1=8,n2=9,nn=1
举一反三
- 设n=n1n2,(n1,n2)=1,n1≥1,n2≥1,则φ(n)=φ(n1)φ(n2).若n=n1n2,n1≥1,n2≥1,则φ(n)=φ(n1)φ(n2)?
- int n=1,a;if(n++==1){ printf("n0=%d\n",n); printf("n1=%d\n",++n); printf("n2=%d\n",n++);}else{ printf("n3=%d\n",n);printf("n4=%d\n",--n);printf("n5=%d\n",n--);}
- 下面N×N的笛卡尔积的子集中,哪些可以构成函数? A: {(n1,n2) | n1,n2∈N and n1+n2 <10} B: {(n1,n2) | n1,n2∈N and n2 = n1^2} C: {(n1,n2) | n1,n2∈N and n1 = n2^2} D: {(n1,n2) | n1,n2∈N and n2为小于n1的素数个数}
- 计算下列序列的N点DFT。(1)x(n)=1(2)x(n)=δ(n)(3)x(n)=δ(n一n0),0<n0<N(4)x(n)=Rm(n),0<m<N(7)x(n)=ejω0nRN(n)(8)x(n)=sin(ω0n)RN(n)(9)x(n)=cos(ω0n)RN(n)(10)x(n)=nRN(n)
- 程序的运行结果是( )[img=196x416]17d6045dbe6bfe2.jpg[/img] A: n=0;n=1; B: n=1;n=2; C: n=2;n=2; D: n=0;n=0;