摘要: 一、指针和一维数组间的关系前提条件:int a[10];//元素个数随意自己定int *p = a;//定义指针时直接初始化,也可以分为两步:int *p; p=a;第i个元素的地址:&a[i] 等价于 a+i 等价于 &p[i] ... 阅读全文
posted @ 2018-11-07 21:48 Sherry_Yue 阅读(932) 评论(0) 推荐(0) 编辑
摘要: 1. 引用#include using namespace std;void swap( int &a, int &b ){ int temp; temp=a; a=b; b=temp;}int main(){ int x=3, y=5; ... 阅读全文
posted @ 2018-11-07 19:24 Sherry_Yue 阅读(161) 评论(0) 推荐(0) 编辑
摘要: 1. 引用#include using namespace std;void swap( int &a, int &b ){ int temp; temp=a; a=b; b=temp;}int main(){ int x=3, y=5; ... 阅读全文
posted @ 2018-11-07 19:24 Sherry_Yue 阅读(199) 评论(0) 推荐(0) 编辑
摘要: #include using namespace std;int main(){ int m, n, r; cin >> m >> n; r = m % n; while( r ) { m = n; ... 阅读全文
posted @ 2018-11-07 19:01 Sherry_Yue 阅读(340) 评论(0) 推荐(0) 编辑
摘要: #include using namespace std;int main(){ int m, n, r; cin >> m >> n; r = m % n; while( r ) { m = n; ... 阅读全文
posted @ 2018-11-07 19:01 Sherry_Yue 阅读(3999) 评论(0) 推荐(0) 编辑