题解 | #规律数列求和#

规律数列求和

https://www.nowcoder.com/practice/e05d1c142b3d4898be7183289a00ce5f

#include<stdio.h>
#include<math.h>
int main()
{
    long long a, b=0;
    int c;
    for (c = 1; c <= 10; c++)
    {
        a = pow(10, c) - 1;
        b +=a;
       
    }
    printf("%lld\n", b);
    return 0;
}

全部评论

相关推荐

2025-12-11 14:24
门头沟学院 Java
牛客35720396...:不要用boss,全是骗
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务