You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
196 B
21 lines
196 B
2 years ago
|
//6.1.1局部对象.cpp
|
||
|
#include <iostream>
|
||
|
|
||
|
using namespace std;
|
||
|
|
||
|
int a();
|
||
|
|
||
|
int main(){
|
||
|
for(int i=0;i<20;i++){
|
||
|
cout << a() << endl;
|
||
|
}
|
||
|
|
||
|
return 0;
|
||
|
}
|
||
|
|
||
|
int a(){
|
||
|
static int i=0;
|
||
|
|
||
|
return ++i;
|
||
|
}
|