题解 | #规律数列求和#
规律数列求和
https://www.nowcoder.com/practice/e05d1c142b3d4898be7183289a00ce5f
#include <cmath> #include <iostream> #include <string> #include <vector> using namespace std; int main() { // write your code here...... long sum; for (int i=1; i<=10; i++) { sum += pow(10, i)-1; } cout << sum << endl; return 0; }