int a=3,b=4,*q=&b; *q=a+b;a=5; q=(a

来源:学生作业帮助网 编辑:作业帮 时间:2024/12/01 04:45:46
xRJA~EH4JEp]!d|"2 .ʠ^fgի^3U "X9wNĈnǓ hn)c>1=)aʣF4DkhKx*ZFլYGUnE6?JgE1|;I3Q3L9~E.*)(t :n+ @HQ&aPkCO 4li>|/_[ps'&U*-t/RfdTʽԸ76fŽFRl\O~U, OרR(ꕭfzOj@t" 5mb7ʼ-CFmZTFE5 C t`
int a=3,b=4,*q=&b; *q=a+b;a=5; q=(a #include void main( ) { int a=3,b=5; int *p,*q; void f1(int x,int y);void f2(int *x,int *y);p=&a; q=&b;f1(*p,*q) ;printf(a=%d ,b=%d ,a,b);f2(p,q);printf(a=%d ,b=%d ,a,b);}void f1(int x,int y) { int t;t=x; x=y; y=t;}void f2(int *x,int *y) { int void fun(int *a,int *b) { int *c; c=a;a=b;b=c; } main() { int x=3,y=5,*p=&x,*q=&y; fun(p,q);...void fun(int *a,int *b){ int *c; c=a;a=b;b=c;}main(){ int x=3,y=5,*p=&x,*q=&y; fun(p,q); printf(%d,%d,,*p,*q); fun(&x,&y); prin%d,%d ,*p,*q);}两 定义int b[3][4],*q[3]; 下列赋值表达式中是正确的A.q=b b.q=*b c.*q=b+1 D.*q=&b[1][2] 为什么呢?A q=bB q=*bC *q=b+1D *q=&b[1][2] swap交换函数,用指针实现.#include stdafx.hvoid swap(int &a,int &b ){int* p=&a;int* q=&b; int* t ;if(*p>*q){ t=p;p=q;q=t;}//a=*p;//b=*q;}int main(){int a=12;int b= 1;printf(a=%d b = %d ,a,b);swap(a,b);printf(a=%d b = %d ,a,b);re #include int f1(int a,int b)15,9 { int c; c=b%2; return a+c; }int f2(int a,int b){ int c;a+=a;b+=b;c=f1(a+b=14,++b9);return c;}void main(){ int a=3,b=4;cout #include int a=3,b=5; max (int a,int b) {int c; c=a>b?a:b; return (c); } void main() {int #include int b=2; int fun(int *k) {b=*k+b;return(b);} main() {int a[10]={1,2,3,4,5,6,7,8}, void fun(int *a,int *b) { int *c; c=a;a=b;b=c; } main() { int x=3,y=5,*p=&x,*q=&y; fun(p,q);...void fun(int *a,int *b){int *c;c=a;a=b;b=c;}main(){int x=3,y=5,*p=&x,*q=&y;fun(p,q); printf(%d,%d,,*p,*q);fun(&x,&y); prin%d,%d ,*p,*q);}两次调用 #include   int inc(int a)   {    return(++a);   }   int multi(int*a,int*b,int*c)   {    return(*c=*a**b);   }   typedef int(FUNC1)(int in);   typedef int(FUNC2) (int*,int*,int*);   void show(FUNC2 fu #include int b=2; int fun(int*k) { b=*k+b;return(b);} main() {int a[10]={1,2,3,4,5,6,7,8}#include int b=2; int fun(int*k) { b=*k+b;return(b);} main() {int a[10]={1,2,3,4,5,6,7,8},i;for(i=2;i int a,b; b = a >> int fm(int a,int b) {if(b==1)return a; else return a+fm(a,b-1); } main( ) { printf(%d ,fm(4,3)) int fm(int a,int b) {if(b==1)return a; else return a+fm(a,b-1); } main( ) { printf(%d ,fm(4,3) #include using namespace std; int main() { int a,b,c; a=3; int f(int x,int y,int z);#include using namespace std; int main() {int a,b,c;a=3;int f(int x,int y,int z); cin>>a>>b>>c;c=f(a,b,c);cout #include void f(int *p,int*q); main() {int m=1,n=2,*r=&m; f(r,&n);printf(%d,%d,m,n);}#include void f(int *p,int*q);main(){int m=1,n=2,*r=&m;f(r,&n);printf(%d,%d,m,n);}void f(int *p,int *q){p=p+1;*q=*q+1;}运行后的结果是A 1,3 B 1,2 说说为 int*a[3] for(int i=0;i>ba[i]=new int[b] } void fun(int a,int b) { int t; t=a;a=b;b=t; } main()void fun(int a,int b){ int t; t=a;a=b;b=t; } main() { int c[10]={1,2,3,4,5,6,7,8,9,0}.i; for(i=0;i