目录

problems
名称POT
题目编号P7226
题目链接luogu.com.cn/…
来源Luogu
算法分类入门_循环
难易程度入门

POT

想法

循环与模拟。

代码实现

#include <cstdio>
 
int main() {
    int n;
    long long int sum = 0;
    scanf("%d", &n);
    for(int i=1; i<=n; i++) {
        int p, temp, t = 1;
        scanf("%d", &temp);
        p = temp % 10;
        temp /= 10;
        for(int j=1; j<=p; j++)
            t *= temp;
        sum += t;
    }
    printf("%lld", sum);
    return 0;
}