题解 | #规律数列求和#
规律数列求和
http://www.nowcoder.com/practice/e05d1c142b3d4898be7183289a00ce5f
#include <iostream>
using namespace std;
int main(){
long long num=0,sum=0;
for(int i=1; i<=10; i++){
num=num*10+9;
sum+=num;
}
cout<<sum;
return 0;
}