K12教育赛事综合服务平台
聚乐之家官方网站
下载聚乐之家官方App
专注青少年竞赛题库网站
#include <iostream> using namespace std; int calc(int n) { if (n == 1) return 1; // 归纳基础 return calc(n-1) + 2*n -1; // 归纳步骤 } int main() { int n; cin >> n; cout << calc(n) << endl; return 0; }
25
15
55
120