写出程序的运行结果,再进行运行比较
来源:互联网 发布:ip反查域名网站 编辑:程序博客网 时间:2024/06/12 21:11
作者:夏晓林
时间:2016.11
问题及代码4:
#include <stdio.h>int main(){ int *p1,*p2,*p; int a=5,b=8; p1=&a; p2=&b; if(a<b) { p=p1; p1=p2; p2=p; } printf("%d,%d\n",*p1,*p2); printf("%d,%d\n",a,b); return 0;}
运行结果:
问题及代码5:
#include<stdio.h>void fun(int x,int y,int *z){ x*=x; y*=y; *z=x+y;}int main(){ int a=5,b=2,c=31; fun(a,b,&c); printf("%d %d %d\n",a,b,c); return 0;}
运行结果:
问题及代码6:
#include<stdio.h>int a, b;void fun(int *p1, int *p2){ *p1=&a;*p2=&b; *p1=100;*p2=200;}int main(){ int a=5, b=7; fun(&a, &b); printf("%d %d\n", a, b); return 0;}
运行结果:
问题及代码7.
#include<stdio.h>#include<malloc.h>int *fun(int x,int y,int *cp){ *cp=x*x+y*y; return cp;}int main(){ int a=4,b=3,*c,*d; c=(int*)malloc(sizeof(int)); d=fun(a,b,c); printf("%d %d\n",*c,*d); return 0;}
运行结果:
0 0
- 写出程序的运行结果,再进行运行比较
- 写出程序运行结果,再进行程序进行比较
- 写出下列程序段的运行结果
- 写出下面程序的运行结果
- 8.1.1 分析写出程序的运行的结果
- 写出下列程序在X86 上的运行结果。
- 阅读下面的程序,并写出运行结果
- 3.1分析并写出下列程序的运行结果。
- 3.1 分析并写出下列程序的运行结果。
- 4.1分析并写出下列程序的运行结果。
- 习题4.1分析并写出下面程序的运行结果
- 分析并写出下列程序的运行结果
- 4.1.分析并写出下面程序的运行结果
- 4.2.分析并写出下面程序的运行结果
- 分析并写出下列程序的运行结果
- 6.分析并写出下列程序的运行结果
- 7.1 分析并写出下面程序的运行结果
- 7.1 分析并写出下面程序的运行结果
- JAVASE之集合(一)【iterable】
- eclipse报错: could not write file 拒绝访问
- BFS循环求迷宫最短路径及路径数
- 30. Substring with Concatenation of All Words
- rides介绍和安装
- 写出程序的运行结果,再进行运行比较
- Mysql支持哪几种索引
- 14. Longest Common Prefix
- LINQ 之查询基础学习笔记(一)
- android RadioButton利用selector 实现Tab功能
- Android自动化测试(UiAutomator)
- Extjs鼠标长按事件(实现长按按钮触发事件的方法:mousedown、mouseup)
- 获取App应用版本信息工具类
- 张宏伦数据可视化20161116