• 2021-04-14
    阅读下列程序段,写出运行结果 ________ 。 struct user_info { charname[20]; int age; charphone[20]; charaddress[80]; }; typedef struct user_infoUSERINFO; inti,j,k; USERINFOtmp; USERINFOuser[5]= { {"Li",31,"62201100","Beijing"}, {"Wang",29,"12347899","Xi an"}, {"Anqi",20,"76769892","Shanghai"}, {"Zhang",46,"87432234","Tianjin"}, {"Yang",33,"87651234","Shenyang"} }; for(i=1;i<5;i++) { k=5-i; for(j=0;j<5-i;j++) if(stricmp(user[j].name,user[k].name)>0) k=j; if(k!=5-i) { tmp=user[k]; user[k]=user[5-i]; user[5-i]=tmp; } } for(i=0;i<5;i++) printf("%s",user[i].name);
  • AnqiLiWangYangZhang

    内容

    • 0

      下列程序段的时间复杂度为( )。 for(i=0;i<m; i++) for(j=0; j<t; j++) c[i][j]=0; for(i=0;i<m; i++) for(j=0;j<t; j++) for(k=0;k<n; k++) c[i][j]=c[i][j]+a[i][k]*b[k][j];

    • 1

      下面程序的运行结果是 。#include<;stdio.h>;main(){int i,j,k=19;while(i=k-1){k-=3;if(k%5==0){i++;continue;}else if(k<;5) break;i++;}printf("i=%d,k=%d\n",i,k);}

    • 2

      int i=3,j=5; int k; k=i&j,k=( ) k=!j, k=( ) k=! j || i , k= ( )

    • 3

      下面程序的运行结果是 。 main( ) { int i,j; for(i=0;i<=3;i++) { for(j=0;j<=5;j++) { if(i==0||j==0||i==3||j==5) printf(“*”); else printf(“ ”); } printf(“ ”); } }

    • 4

      以下程序的运行结果是____。#include<stdio.h>main(){inti,j,k;for(i=1;i<=6;i++){for(j=1;j<=20-3*i;j++)printf("");for(k=1;k<=i;k++)printf("%3d",k);for(k=i-1;k>0;k--)printf("%3d",k);printf("\n");}}