#include <type_traits>
class add{public:static int count;static int tmp;add(){count=count+tmp;tmp++;}
};
int add::count=0;
int add::tmp=1;
class Solution {
public:int Sum_Solution(int n) {add a[n];return add::count;}
};
一、改MainActivity
class MainActivity : AppCompatActivity() {/*因Android的app有生命周期,故入口是OnCreate而不是main函数*/override fun onCreate(savedInstanceState: Bundle?) {super.onCreate(savedInstanceState)setContentView(R.layout.activity_main…