编程介的小学生 2017-06-15 15:44 采纳率: 20.3%
浏览 726
已采纳

Calculate the formula

Problem Description
You just need to calculate the sum of the formula: 1^2+3^2+5^2+……+ n ^2.

Input
In each case, there is an odd positive integer n.

Output
Print the sum. Make sure the sum will not exceed 2^31-1

Sample Input
3

Sample Output
10

  • 写回答

2条回答 默认 最新

  • threenewbee 2017-06-17 16:34
    关注
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 树莓派4b怎么安装ubuntu20.04桌面版,现在官网搜不到ubuntu20.04桌面版的,有资源吗
  • ¥15 汇川easy320 for循环问题
  • ¥15 一个用华为模拟器做的实验。
  • ¥15 SD的animatediff插件报错,只出单张图片,出不来动图
  • ¥28 opencv Cuda C++编译
  • ¥15 插入sim卡4g模组反复断连
  • ¥100 如何把 16bit Bayer 图像数据转换为 TIFF RGB
  • ¥15 进行基于用户的协同过滤推荐,使用准确率和召回率评价推荐模型的效果
  • ¥15 关于#cesium#的问题:cesium 根据经纬度、高度、方位角、俯仰角和距离求另一点高度
  • ¥15 word脚注设置不起空格符号