View Code of Problem 86

#include <iostream>
#include "string"

using namespace std;

/**
 * kkmd66 四刷
 * @return
 */
int main() {

    int n;
    string a;
    cin >> a >> n;
    //结果
    long long result = 0;
    //寄存
    string temp = a;
    //累加
    for (int i = 1; i <= n; ++i) {
        result += atoi(temp.c_str());
        temp += a;
    }
    //输出
    cout << result;

    return 0;
}

Double click to view unformatted code.


Back to problem 86