自学习指针后,自己利用指针编写判断三个数的大小。
2015-09-16 17:30
288 查看
//自己把指针看懂后,编的的小程序,分享下小喜悦。
#import
int abc(*p1,t*p2,*p3)
{
int temp=*p1;
if (temp<*p2) {
temp=*p2;
}
if (temp<*p3) {
temp=*p3;
}
return temp;
}
int main(int argc, const char * argv[])
{
@autoreleasepool {
int *p1,*p2,*p3;
int a,b,c;
scanf("%d%d%d",&a,&b,&c);
p1=&a;
p2=&b;
p3=&c;
int temp=abc(p1,p2,p3);
printf("%d",temp);
}
return 0;
}
#import
int abc(*p1,t*p2,*p3)
{
int temp=*p1;
if (temp<*p2) {
temp=*p2;
}
if (temp<*p3) {
temp=*p3;
}
return temp;
}
int main(int argc, const char * argv[])
{
@autoreleasepool {
int *p1,*p2,*p3;
int a,b,c;
scanf("%d%d%d",&a,&b,&c);
p1=&a;
p2=&b;
p3=&c;
int temp=abc(p1,p2,p3);
printf("%d",temp);
}
return 0;
}
相关文章推荐
- kettle使用-txt去除空格
- URL命名规则
- linux内存管理解析
- 关于在Linux的堆栈段执行代码的实践和思考
- Windows 任务管理器中的几个内存概念
- OpenSSL小结
- VC中的GetKeyState和GetAsyncKeyState的区别
- Android数据存储--SharedPreferences--共享数据存储
- sql server数据库文件的迁移(mdf&ldf文件)
- VB6.0 和VB.NET 函数对比
- Lucene(讲的不错,借鉴一下)
- 在Xcode6下IOS Crash Log分析文一
- 页面加载速度优化的12个建议
- LeetCode题解——Sliding Window Maximum
- IO流详解
- LoadRunner常见问题解决方法
- javascript实现在图片读取的时候出现进度条….
- tomcat 环境配置
- 子线程中处理UI,抛异常 android.view.ViewRootImpl$CalledFromWrongThreadException: Only the original
- SGU101 无向图欧拉路径