原题链接:http://www.acm.uestc.edu.cn/problem.php?pid=1735

考试松松过 

 1 #include<cstdio>
 2 using namespace std;
 3 int main()
 4 {
 5     long long n,product;int ans[20];
 6     while(scanf("%lld",&n)!=EOF)
 7     {
 8         product=(n+1)*(3*n+2)/2;
 9         int i=0;
10         while(product)
11         {
12             ans[i++]=product%10;
13             product/=10;
14         }
15         for(int j=i-1;j>=0;j--)
16         printf("%d",ans[j]);
17         printf("\n");
18     }
19     return 0;
20 }
21                      

 

相关文章:

  • 2021-12-06
  • 2021-10-13
  • 2021-07-23
  • 2021-10-31
  • 2021-12-07
  • 2021-09-04
  • 2021-07-26
  • 2021-06-16
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-12-29
  • 2022-01-20
  • 2022-02-22
  • 2021-06-16
  • 2021-09-12
相关资源
相似解决方案