#include struct A {int a; char b[10]; double c; }; void f(struct A t); main() {struct A a={1001,"ZhangDa",1098.0};f(a); printf("%d,%s,%6.1f",a.a,a.b,a.c);} void f(struct A t) {t.a=1002; strcpy(t.b,"ChangRong");t.c=1202.0;}
举一反三
- 有以下程序#include;#include;structA{inta;charb[10];doublec;};voidf(structAt);main(){structAa={1001,"ZhangDa",1098.0};f(a);printf("%d,%s,%6.1f",a.a,a.b,a.c);}voidf(structAt){t.a=1002;strcpy(t.b,"ChangRong");t.c=1202.0;}程序运行后的输出结果是() A: 1002,ZhangDa,1202.0 B: 1001,ChangRong,1098.0 C: 1001,ZhangDa,1098.0 D: 1002,ChangRong,1202.0
- 有以下程序[br][/br]#include[br][/br]#include[br][/br]struct[br][/br]{inta;charb[10];doublec;};[br][/br]voidf(structAt);[br][/br]main()[br][/br]{structAa={1001,"ZhangDa",1098.0};[br][/br]f(a);printf("%d,%s,%6.1f\n",a.a,a.b,a.c);[br][/br]}[br][/br]voidf(structAt)[br][/br]{t.a=1002;strcpy(t.b,"ChangRong");t.c=1202.0;}[br][/br]程序运行后的输出结果是 A: 1002,ZhangDa,1202.0 B: 1002,ChangRong,1202.0 C: 1001,ChangRong,1098.0 D: 1001,ZhangDa,1098.0
- 有以下程序#include<stdio.h>#include<string.h>structA{inta;charb[10];doublec;};structAf(structAt);main{structAa={1001,ZhangDa,1098.0};a=f(a);printf(%d,%s,%6.1f\n,a.a,a.b,a.c);}structAf(structAt) A: A)1001,ChangRong,1098.0 B: B)1001,ZhangDa,1098.0 C: C)1002,ChangRong,1202.0 D: D)1002,ZhangDa,1202.0
- 下列程序的运行结果为structA{inta;charb[10];doublec;};voidf(structA*t);main(){structAa={1001,"ZhangDa",1098.0}; f(&a); printf("%d,%s,%6.1f\n",a.a,a.b,a.c);}voidf(structA*t){strcpy(t->b,"ChangRong");}
- 有以下程序:<br/>#include<stdio.h><br/>#include<string.h><br/>structA<br/>{<br/>inta;<br/>charb[10];<br/>doublec;<br/>};<br/>voidf(structAt);<br/>main()<br/>{<br/>structAa={1001,"ZhangDa",1098.0};<br/>f(a);<br/>printf("%d,%s,%6.1f\n",a.a,a.b,a.c);<br/>}<br/>voidf(structAt)<br/>{<br/>t.a=1002;<br/>strcpy(t.b,"ChangRong");<br/>t.c=1202.0;<br/>returnt;<br/>}<br/>程序运行后的输出结果是()。 A: 1001,ZhangDa,1098.0 B: 1002,ChangRong,1202.0 C: 1001,ChangRong,1098.0 D: 1002,ZhangDa,1202.0