fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int f(int a) {
  5. static int b = a;
  6. return b;
  7. }
  8.  
  9. int main() {
  10. cout << f(1) << endl;
  11. cout << f(2) << endl;
  12. cout << f(3) << endl;
  13. return 0;
  14. }
Success #stdin #stdout 0s 3340KB
stdin
Standard input is empty
stdout
1
1
1