#include<stdio.h>

int main(void){
int n1, n2,n3;
n1=333*(3+999)/2;
n2=199*(5+995)/2;
n3=66*(15+990)/2;
printf("%d\n",n1+n2-n3);
n1=getchar();
return 0;
}

Multiples of 3 and 5

Problem 1

If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23.

Find the sum of all the multiples of 3 or 5 below 1000.

点击打开链接

算法

Multiples of 3 and 5的更多相关文章

  1. 【算法题】Multiples of 3 and 5

    Multiples of 3 and 5 原题 题意如下: 找出N以内的3和5的倍数的和. 思路 1.刚看到觉得好弱智,直接遍历一遍不就OK了吗?但是第2和第3个测试用例报了TLE,超时. 2.然后想 ...

  2. 【CSS3】Advanced8:CSS Backgrounds: Multiples, Size, and Origin

    1.Multiples,Size,and Origin eg:background-image:url(bg.png),url(bullet.png) 0 50% no-repeat,url(arro ...

  3. (Problem 1)Multiples of 3 and 5

    If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The ...

  4. Problem 1: Multiples of 3 and 5

    小白一枚,python解法,共同学习,一起进步. Problem 1: Multiples of 3 and 5 If we list all the natural numbers below 10 ...

  5. Codeforces Round #506 (Div. 3) D. Concatenated Multiples

    D. Concatenated Multiples You are given an array aa, consisting of nn positive integers. Let's call ...

  6. R语言学习——欧拉计划(1)Multiples of 3 and 5

    [题目一]If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. ...

  7. 【Project Euler 1】Multiples of 3 and 5

    题目要求是: If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and ...

  8. LightOJ--1149--Factors and Multiples(二分图好题)

    Factors and Multiples Time Limit: 2000MS   Memory Limit: 32768KB   64bit IO Format: %lld & %llu ...

  9. Factors and Multiples

    Factors and Multiples   PDF (English) Statistics Forum Time Limit: 2 second(s) Memory Limit: 32 MB Y ...

随机推荐

  1. angular animate

    angular animate 有3种:1,css transition. 2,css keyframe. 3,javascript 用jquery的animate方法: 1,2 两种是纯粹css的, ...

  2. js 数组去重

    这是一道常见的面试题,最近在做[搜索历史记录]功能也用到,开始用了 indexOf 方法,该方法在 ECMA5才有支持,对于 IE8- 就不支持了. 我们可以自己写一个函数(Array对象的方法都是定 ...

  3. 实用工具 : Xaml Power Toys

    最近挺忙, 憋了一肚子的东西没有分享. 今天分享一个 Xamarin.Forms / WPF 的增强工具 , Visual Studio 扩展 : Xaml Power Toy 可以直接在 VS201 ...

  4. js的offsetWidth,offsetHeight,offsetLeft,offsetTop

    js的offsetWidth,offsetHeight,offsetLeft,offsetTop

  5. LCA倍增算法的错误与模板

    先上我原来的错误的代码 type node=^link; link=record num:int64; next:node; end; var fa:..,..] of int64; dep:..] ...

  6. 如果在敲代码的时候eclipse不弹出提示,怎么办?

    非常弱智的操作,我们曾经在输入System.out.println("content");的时候,当我们输入了"."之后,在输入错误,此时我们再回退至" ...

  7. 在eclipse下如何安装下载好的插件

    我们下载到的插件,如果是一个jar格式的包,那么我们所需要做的事,就是 第一,新建一个名为plugins的文件夹, 第二,新建一个名为eclipse的文件夹,再将plugins复制进eclipse中, ...

  8. 【jQuery EasyUI系列】 创建展开行明细编辑表单的CRUD应用

    当切换数据网络格局(datagrid view)到detailview,用户可以展开一行来显示一些行的明细在行下面,这个功能允许您为防止在明细行面板中的编辑表单提供一些合适的布局. 步骤1.在HTML ...

  9. Web服务器磁盘满故障

    问题: 硬盘显示被写满,但是用du -sh /*查看时占用硬盘空间之和还远小于硬盘大小,即找不到硬盘分区是怎么被写满的.今天下午接到同事紧急求助,说生产线服务器硬盘满了.该删的日志都删掉了.可空间还是 ...

  10. c++中STL库简介及使用说明

    作为C++标准不可缺少的一部分,STL应该是渗透在C++程序的角角落落里的.STL不是实验室里的宠儿,也不是程序员桌上的摆设,她的激动人心并非昙花一现.本教程旨在传播和普及STL的基础知识,若能借此机 ...