文章

11

粉丝

406

获赞

3

访问

79.4k

头像
非嵌套logn算法
P1168 清华大学上机题
发布于2022年3月8日 11:15
阅读数 5.0k

#include<iostream>
#include<cstdlib>
#include<cstdio>
using namespace std;

int main(){
    int a,b,a_sum,res;
    while(~scanf("%d%d",&a,&b)){
        a_sum=0,res=0;
        while(a){
            a_sum+=a%10;
            a/=10;
        }
        while(b){
            res+=a_sum*(b%10);
            b/=10;
        }
        printf("%d\n",res);
    }
    return 0;
}

 

登录查看完整内容


登录后发布评论

暂无评论,来抢沙发