#include <iostream>
using namespace std;
int i=10;
static int reset(),next( int),last( int),other( int);
int main(int argc, char** argv)
{
int i=reset();
for( int j( 1); j <= 3; j++)
{
cout << ">>>>>>>>>>>>>>>>"<<endl;
cout << "j(1)=" << "j=" << j<<endl;
cout << " i=" <<i << ",";
cout <<" next( i)=" <<next( i) <<" ,";
cout << "last( i)=" << last( i) << " ";
cout << "other( i +j)="<< other( i +j) <<endl;
}
// return 0;
}
static int reset()
{
return 2;
cout << "reset()=" << reset() << endl;
}
static int next(int j)
{
j=i++;
cout << "j=" << j<< endl;
return j;
}
static int last( int j)
{
static int i(20);
j = i--;
cout << "j=" << j <<endl;
return j;
}
static int other( int j)
{
int i(15);
cout << "i=j+=i=" << i << endl;
return i=j+=i;
}
>>>>>>>>>>>>>>>>
j(1)=j=1
i=2,j=10
next( i)=10 ,j=20
last( i)=20 i=j+=i=15
other( i +j)=18
>>>>>>>>>>>>>>>>
j(1)=j=2
i=2,j=11
next( i)=11 ,j=19
last( i)=19 i=j+=i=15
other( i +j)=19
>>>>>>>>>>>>>>>>
j(1)=j=3
i=2,j=12
next( i)=12 ,j=18
last( i)=18 i=j+=i=15
other( i +j)=20
bd@Baolin-Dong-desktop:~/Documents$
C++部分程序
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.