main.cpp
#include<iostream>
using namespace std;
void fn1();
int n;
int main()
{
n=100;
fn1();
cout<<n<<endl;
return 0;
}
fn1.cpp
#include<iostream>
#include<cmath>
using namespace std;
extern int n;
void fn1()
{
n++;
}
main.cpp
#include<iostream>
using namespace std;
void fn1();
int n;
int main()
{
n=100;
fn1();
cout<<n<<endl;
return 0;
}
fn1.cpp
#include<iostream>
#include<cmath>
using namespace std;
extern int n;
void fn1()
{
n++;
}