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