Slide 13
Slide 13 text
ソースコード
#include
#include
using namespace std;
int64_t sigma(int64_t n, int64_t ans){
if(n <= 0) return ans;
else return sigma(n - 1, ans + n);
}
int main(){
cout << "sigma(100): " << sigma(100, 0) << endl;
cout << "sigma(10000000): " << (int64_t)sigma(10000000, 0) << endl;
}
2022/06/03
© 2022 @Shinonome517Stu 13