A: qian==’˽’&&s[i]!=’˽’
B: qian==’˽’&&s[i]==’˽’
C: qian!=’˽’&&s[i+1]!=’˽’.
D: qian!=’˽’&&s[i]!=’˽’
举一反三
- 以下程序的功能只保留字符串的小写字母,请将程序补充完整。#include void fun(char s[]) { int i,j; for(i=0,j=0;s[i]!='\0';i++) if ( (1) ) { s[j]=s[i]; (2) ; } s[j]='\0'; } void main() { char s[100]="abc123abc123abc"; (3) ; puts(s); }(1)应该填写的是:[/i][/i] A: s[i]>='a'&&s[i]<='z' B: s[i]>='A'&&s[i]<='Z C: s[i]>='0'&&s[i]<='9' D: s[i]>=a&&s[i]<=z
- 已定义float a; int i;选择正确的输入格式为( ) A: scanf("%f%d", a,i); B: scanf("%6d%3d",&a,&i); C: scanf("%lf%s", &a,&i); D: scanf("%6f%3d", &a,&i);
- 已定义float a; int i;选择正确的输入格式为( ) A: scanf("%f%d", a,i); B: scanf("%6d%3d",&a,&i); C: scanf("%lf%s", &a,&i); D: scanf("%6.2f%3d", &a,&i);
- \(A\)同上题,将其对角化\(A=S\Lambda S^{-1}\)的方阵\(S\)可以是 A: \(\begin{pmatrix} 1 & 1 & 1 & 1 \\ 1 & 1 & 1 & 0 \\ 1 & 1 & 0 & 0 \\ 1 & 0 & 0 & 0 \end{pmatrix}\) B: \(\begin{pmatrix} 1 & 0 & 0 & 0 \\ 0 & 0 & 1 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 0 & 1 \end{pmatrix}\) C: \(\begin{pmatrix} 1 & 0 & 0 & -1 \\ 0 & 1 & -1 & 0 \\ 0 & 1 & 1 & 0 \\ 1 & 0 & 0 & 1 \end{pmatrix}\)
- 有定义语句:intb;charc[10];,则正确的输入语句是()。 A: scanf("%d%s",&amp;b,&amp;c); B: scanf("%d%s",&amp;b,c); C: scanf("%d%s",b,c); D: scanf("%d%s",b,&amp;c);
内容
- 0
已知i,j为int型变量,若从键盘输入:2,3,使i的值为2,j的值为3,以下选项中正确的输入语句是()。 A: scanf(“%2d%2d”,&i,&j); B: scanf(“%d,%d”,&i,&j); C: scanf(“i=%d,j=%d”,&i,&j); D: scanf(“%d_%d”,&i,&j);
- 1
下列程序段可以正确运行的有: A: int i,s,x;s=0;i=0;while(1){ scanf("%d",&x); if(x!=-1) { s=s+x; i++; } else break;}printf("ave=%d\n",s/i); B: int i,s,x;s=0;i=0;scanf("%d",&x);while(x!=-1){ s=s+x; i++; scanf("%d",&x);}printf("ave=%d\n",s/i); C: int i,s,x;s=0;i=0;while(1){ scanf("%d",&x); if(x==-1) break; s=s+x; i++; }printf("ave=%d\n",s/i);
- 2
若已定义char s[2][10];则下面表达式中代表s[1][2]地址的是:选择一项: A: &s[1]+2 B: &s[0]+1+2 C: &s[1][1]+1 D: &s[0][0]+12
- 3
若有定义int x;char s[20];正确的输入语句是( )。 A: scanf("%d %c",&x,&s); B: scanf("%d %c",&x,s); C: scanf("%d %s",&x,&s); D: scanf("%d %s",&x,s);
- 4
设有以下变量定义float a; int i;选择正确的输入语句是( ); A: scanf ("%f%d", a,i); B: scanf ("%6.2f%d", &a,&i); C: scanf ("%f%d", &a,&i); D: scanf ("%f%u", &a,&i);