C++:谁能用C++帮我编个程序(点进来看要求)?

[复制链接]
查看11 | 回复3 | 2008-11-24 18:16:50 | 显示全部楼层 |阅读模式
要求:
使用指针完成一维数组的逆置!

回复

使用道具 举报

千问 | 2008-11-24 18:16:50 | 显示全部楼层
#include using namespace std;int main(){ int a[5]={1,2,3,4,5}; int temp; int i=0; while(i<5/2) {temp=*(a+i);*(a+i)=*(a+4-i);*(a+4-i)=temp;i++; } for(int j=0;j<5;j++)cout<<*(a+j)<<endl; return 0;}...
回复

使用道具 举报

千问 | 2008-11-24 18:16:50 | 显示全部楼层
#include #define MAX_NUM 8 using namespace std; void swap(int &x, int &y) { int z = 0; z = x; x = y; y = z; } void display(int a[]) { for(in...
回复

使用道具 举报

千问 | 2008-11-24 18:16:50 | 显示全部楼层
//---------------------------------------------------------------------------#include #define SSIZE 10using namespace std;int main(void){ int a[SSIZE]; in...
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行