程序: include <stdio.h> include <string.h> typedef struct{char name[9];char sex;float score[2]}STU; STU f(STU A) {STU b={"Zhao",&39;m&39;,85.0,90.0}; int i; strcpy(a.name,b.namC) ; a.sex=b.sex; for(i=0;i<2;i++) a.score[i]=b.score[i]; return a; } main() {STU c={"Qian",&39;f&39;,95.0,92.0},d; d=f(C) ; pintf("%s,%c,%2.of.%2.of\n",d.name,d.sex,d.score[0],&score[1]); } 程序的运行结果是()。
A.Qian,f,95,92
B.Qian,m,85,90
C.Zhao,m,85,90
D.Zhao,C95,92
时间:2023-10-09 16:23:59
-
阅读下列程序,则在执行后,程序的运行结果为( ).#include stdio.h#include string.hmain( ){ char a[30]=nice to meet you!
-
下面程序的运行结果是______。 #include < stdio.h > #include < string.h > main() { char a[7]=\abcdef\,b[4]=\ABC
-
如果在下面程序运行时输入123456,程序的运行结果是【 】。 include<stdio.h>int main(); }
A.12,56
B.12,34
C.34,56
D.123456
-
有以下程序: include <stdio.h> void f(); } 执行后的输出结果【 】。
-
以下程序的运行结果是【 】。 include<stdio.h> main() { int fun(); fun();} fun (
以下程序的运行结果是【 】。 include<stdio.h> main() { int fun(); fun();} fun () { static int a[3]={0,1,2}; int i; for(i=0;i<3;i++)a[i]+=a[i]; for(i=0;i<3;i++)printf("%d,",a[i]); printf("\n");}
-
下述程序执行的输出结果是()。 include<stdio.h> main() {char a[2][4]; , strcpy(
下述程序执行的输出结果是()。 include<stdio.h> main() {char a[2][4]; , strcpy(a。"are");strcpy(a[1],"you"); a[o][3]=&; printf("%s\n",a); }
A.are&you
B.you
C.are
D.&
-
有以下程序: include<stdio.h> main() {printf("%d\n",NULL)); 程序运行后的输出结果是()。
A.0
B.1
C.-1
D.NULL没定义,出错
-
include<stdio.h>main(); } 程序运行后的输出结果是
A.0,0
B.0,-1
C.-1,-1
D.结果不确定
-
有以下程序 include<stdio.h>void main()
A.10 9 8
B.9 8 7
C.10 9 8 7
D.9 8 7 6
-
下列程序的输出结果是______。 include<stdio.h> main(); }
-
请根据程序中的注释,把程序补充完整 include <stdio.h> struct student { char name[20];
请根据程序中的注释,把程序补充完整 include <stdio.h> struct student { char name[20]; double score; }; int main() { struct student s; //用scanf函数读入一个学生的姓名、和成绩,存入s (________________________________); printf("%s\t%.1f\n", s.name, s.score); return 0; }
-
阅读以下说明和C++程序,将应填入(n)处的字句写在对应栏内。【C++程序】include < stdio. h >include
阅读以下说明和C++程序,将应填入(n)处的字句写在对应栏内。
【C++程序】
include < stdio. h >
include < string. h >
define Max 1000
class Bank
{
int index;
char date [Max] [10]; // 记录交易日
iht amount[Max]; // 记录每次交易金额,以符号区分存钱和取钱
int rest[ Max]; // 记录每次交易后余额
static iht sum; // 账户累计余额
public:
Bank() {index =0;}
void deposit(char d[ ] , int m) //存入交易
{
strcpy (date [ index ], d);
amount[ index] = m;
(1);
rest[ index] = sum;
index++;
}
void withdraw (char d[ ], int m) //取出交易
{
strcpy(date[ index] ,d);
(2);
(3);
rest[ index] = sum;
index++;
}
void display();
};
int Bank:: sum = 0;
void Bank:: display () //输出流水
{
int i;
printf("日期 存入 取出 余额\n");
for (4)
{
printf(" %8s" ,date[i] );
if (5)
printf(" %6d" , -amount[i] );
else
printf("%6d ",amount[i] );
printf("% 6d\n" ,rest[i] );
} }
void main()
{
Bank object;
object. deposit ("2006.2.5", 1 00 );
object. deposit("2006.3.2" , 200);
object. withdraw("2006.4.1", 50);
object. withdraw("2006.4.5", 80);
object. display ();
}
本程序的执行结果如下:
日期 存入 取出 余额 2006.2.5 100 100
2006.3.2 200 300
2006.4.1 50 250
2006.4.5 80 170
-
有以下程序(strcat函数用以连接两个字符串) include<stdio.h> include<string.h>。
有以下程序(strcat函数用以连接两个字符串) include<stdio.h> include<string.h>。 main {char a[20]="ABCD\oEFG\0",h[]="IJK"; strcat(a,b);printf("%s\n",a); ) 程序运行后的输出结果是()。
A.ABCDE\0FG\0IJK
B.ABCDIJK
C.IJK
D.EFGIJK
-
有以下程序 include<stdio.h>include<string.h>void fun(); } 程序运行后的输出结果是
A.012345
B.876543210
C.876543
D.012345678
-
有以下程序includ<stdio.h>main(){printf("%"NUL);}程序运行后的输出结果是()
A.1
B.变量无定义,输出不确定
C.-1
D.0
-
给出下面程序的运行结果。include<stdio.h>intmain();return0;}
A.6
B.3
C.4
D.5
-
有以下程序 include<stdio.h>include<string.h>typedef struct stu { char name[10]; char gender; int score; } STU; void f(); } 程序的运行结果是
A.Zhao,m,290,Zhao,m,290
B.Zhao,m,290,Qian,m,290
C.Zhao,m,290,Qian,m,350
D.Zhao,m,290,Qian,f,350
-
现有如下程序段,则程序段的输出结果为【16】。 include’stdio.h’ intfun()}
-
以下程序的输出为()include<stdio.h>void main(){inty=5;while(y--);printf("y=%d\n",y);}</stdio.h>
A.y=0
B.无限循环,无结果输出
C.y=1
D.y=-1
-
运行程序输入hello↙和world↙,写出输出结果。 include <stdio.h>
-
有以下程序: include<stdio.h> main() } int y=9; for(y>0;
有以下程序: include<stdio.h> main() } int y=9; for(y>0;y--) if(y%3==0)printf(“%d”,--y); } 程序的运行结果是()。
A.741
B.963
C.852
D.875421
-
有以下程序include ’stdio.h’min()} 程序的运行结果是3 B.5C.7 D.8
A.3
B.5
C.7
D.8
-
有以下程序 include<stdio.h> include<stdio.h> intfun()); } 程序的运行结果是10 B.20 C.0 D.出错
A.10
B.20
C.0
D.出错
-
若使用printf输出结果,则必须在程序前添加include <stdio.h>
-
以下程序的输出结果是()include <stdio.h> int fun(int x)
A.2
B.3
C.7
D.0