1013: [编程入门]Sn的公式求和(最简单解法)
摘要:解题思路:注意事项:参考代码:#include<stdio.h>int main(){ int a=2,sum=0,i,n; scanf("%d",&n); for(i=0;i<n;……
1013: [编程入门]Sn的公式求和
摘要:解题思路:注意事项:参考代码:def sno(i): stable = 2 output = 0 while i >……
1013,for循环解决
摘要:#######includeint main(){ int a=2,n,term=0,sum=0,i; scanf("%d",&n); for(i=1;i……
利用循环得到n次的数字,然后求和
摘要:解题思路:每次循环把上一个值乘10再加上结尾的2注意事项:跳出循环后还需要再算一次和参考代码:int main(){ int a=2,n;&……