标签:os io for div c ios return include
#include <iostream>
using namespace std;
int main()
{
int n,a,sum=0;
cout<<"please input n and a:"<<endl;
cin>>n>>a;
for(int i=1;i<=n;i++)
{
sum+=a;
a=a+10*a;//不断赋值替换之前的数值
}
cout<<sum<<endl;
return 0;
7.求sum=a+aa+aaa+···+a···a(n个a),其中a和n由键盘输入,布布扣,bubuko.com
7.求sum=a+aa+aaa+···+a···a(n个a),其中a和n由键盘输入
标签:os io for div c ios return include
原文地址:http://www.cnblogs.com/jixiaowu/p/3890259.html