[单选题]

以下程序(程序左边的数字为符加的行号)。1include2include3main()4{char s[]="

以下程序(程序左边的数字为符加的行号)。 1#include<str.h> 2#include<stdio.h> 3main() 4{ char s[]="string"; 5puts(s); 6strcpy(s,"hello"); 7printf("%3s/n",s);}

A.没有错

B.第1行有错

C.第6行有错

D.第7行有错

参考答案与解析:

相关试题

以下程序(程序左边的数字为附加的行号)______。1#include2#inc

[单选题]以下程序(程序左边的数字为附加的行号)______。1include2include3main()4{char以下程序(程序左边的数字为附加的行号)______。 1#include<str.h> 2#include<stdio.h> 3main() 4{ chars[]="string"; 5puts(s); 6strcpy(s,"hello"); 7printf("%3S/n",s);}A.没有错B.第1行有错C.第6行有错D.第7行有错

  • 查看答案
  • 有以下程序 #include main() {int a[]={1,2,3,4

    [单选题]有以下程序 include main() {int a[]={1,2,3,4,5,6,7,8,9,10,11,12,},*p=a£«5,*q=N有以下程序#include <stdio.h>main( ){int a[ ]={1,2,3,4,5,6,7,8,9,10,11,12,},*p=a+5,*q=NULL;*q=*(p+5);printf("%d %d/n",*p,*q);}程序运行后的输出结果是A.运行后报错B.6 6C.6 11D.5 10

  • 查看答案
  • 有以下程序:#include #include main(){char *p[1

    [单选题]有以下程序:include include main(){char *p[10]={"abc","aabdfg","dcdbe"有以下程序: #include <stdio.h> #include <string.h> main() { char *p[10]={"abc","aabdfg","dcdbe","abbd","cd"}; printf("%d/n",strlen(p[4])); } 执行后的输出结果是( )。A.2B.3C.4D.5

  • 查看答案
  • 有以下程序 #include mare() { int x=1,y=2,z=3

    [单选题]有以下程序 include mare() { int x=1,y=2,z=3; if(x>y) if有以下程序 #include <stdio.h> mare() { int x=1,y=2,z=3; if(x>y) if(y<z) printf("%d",++z); else printf("%d",++y); printf("%d/n",x++); } 程序的运行结果是______。A.331B.41C.2D.1

  • 查看答案
  • 有以下程序:#include main( ){int a[3][2]={0} ,

    [单选题]有以下程序:include main( ){int a[3][2]={0} ,( *ptr)[2],i,j;for(i=0;i<2;i£«£«) {ptr有以下程序: #include <stdio.h> main( ) { int a[3][2]={0} ,( *ptr)[2],i,j; for(i=0;i<2;i++) {ptr=a+i; scanf("%d",ptr); ptr++;} for(i =0;i<3;i ++ ) } for(j =0;j<2;j ++ ) prinff(

  • 查看答案
  • 有以下程序:#include main( ){int a[ ] = { 1,2,

    [单选题]有以下程序:include main( ){int a[ ] = { 1,2,3,4,5,6,7,8,9,0} , * p;for(p =a;p有以下程序:#include <stdio. h>main( ){ int a[ ] = { 1,2,3,4,5,6,7,8,9,0} , * p; for(p =a;p<a+10;p++) printf("%d," , *p); }程序运行后的输出结果是( )。A.1,2,3,4,5,6,7,8,9,0,B.2,3,4,5,6,7,8,9,10,1

  • 查看答案
  • 有以下程序: #include main( ){ int m =3,n =4,x

    [单选题]有以下程序: include main( ){ int m =3,n =4,x; x= £­m£«£«; x=x£«8£¯£«£«n; prinff(" % d有以下程序: #include <stdio. h > main( ) { int m =3,n =4,x; x= -m++; x=x+8/++n; prinff(" % d /n" ,x); } 程序运行后的输出结果是( )。A.3B.5C.-1D.-2

  • 查看答案
  • 有以下程序 #include #include typedef struct

    [单选题]有以下程序 include include typedef struct { cha有以下程序 #include <stdio.h> #include <string.h> typedef struct { char name[9]; char sex; float score[2]; } STU; STU f(STU a) { STU b={"Zhao", 'm', 85.0, 90.0}; int i; strcpy(a.name, b.name); a.sex = b.sex;

  • 查看答案
  • 有以下程序 #include #include typedef stmct{

    [单选题]有以下程序 include include typedef stmct{ char name[9];char sex;flo有以下程序#include <stdio.h>#include <string.h>typedef stmct{ char name[9];char sex;float score[2];}STU;void f(STU a){ STU b={"Zhao",'m',85.0,90.0}; int i;strcpy(a.name,b.name) ;a.sex=b.s

  • 查看答案
  • 有以下程序:#include #include using namespace

    [单选题]有以下程序:include include using namespace std;int main ( ){ char b1[8有以下程序: #include <iostream> #include <string> using namespace std; int main ( ) { char b1[8] = "abcdefg"; char b2[8],*pb=b1+3; while (--pb>=b1) strcpy (b2, Pb) ; cout<<strlen (b2) <<en

  • 查看答案