#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. MVC UpdateModel的未能更新XXXXX的类型模型

    关于MVC  UpdateModel的未能更新XXXXX的类型模型 的问题: 最近做MVC3的项目,相信很多人都碰到过这个问题,在此记录一下,异常:UpdateModel的未能更新XXXXX的类型模型 ...

  2. 让Apache Shiro保护你的应用

    在尝试保护你的应用时,你是否有过挫败感?是否觉得现有的Java安全解决方案难以使用,只会让你更糊涂?本文介绍的Apache Shiro,是一个不同寻常的Java安全框架,为保护应用提供了简单而强大的方 ...

  3. SQLServer(MSSQL)、MySQL、SQLite、Access相互迁移转换工具 DB2DB v1.2

    最近公司有一个项目,需要把原来的系统从 MSSQL 升迁到阿里云RDS(MySQL)上面.为便于测试,所以需要把原来系统的所有数据表以及测试数据转换到 MySQL 上面.在百度上找了很多方法,有通过微 ...

  4. 一起来学node.js吧 node school简介

    node.js这几年火爆的简直丧心病狂,去lagou.com查查node.js的职位,那叫一个多. 要说火爆到什么程度,竟然有一个网站专门去教大家学习node.js, Node School. 进去逛 ...

  5. Firefox about

    在firefox的地址栏输入about:about,然后看一下各个链接.有的链接有具体的用途,有的链接疯言疯语,并无软用. about:about集中了火狐浏览器的全部用户界面,平时常见的prefer ...

  6. Linux下sysstat工具学习

    Linux下,我们多用ssh链接服务器远程操控.对于系统的监控必不可少,sysstat很不错的监控工具包. sysstat官网:http://sebastien.godard.pagesperso-o ...

  7. 【Python】[函数式编程]高阶函数,返回函数,装饰器,偏函数

    函数式编程高阶函数 就是把函数作为参数的函数,这种抽象的编程方式就是函数式编程.--- - -跳过,不是很理解,汗 - ---

  8. 屠龙之路_转角遇到服务器大魔王_FourthDay

    Day4:将View打败后,View还送了屠龙团一个信物.于是在今天的旅途中,少年们在遇到View的其他兄弟时,以此信物将他们收于麾下,并借助他们的力量打败了服务器大魔王." Fightin ...

  9. 屠龙之路_击败DB小boss_FifthDay

    摘要:服务器大魔王被击败的消息传到了恶龙boss那里,恶龙大怒派出了自己的首级大将DB人称小boss,但小boss的名号并没有吓到七位屠龙勇士,经过他们齐心协力的进攻,最终击败了DB,小boss临死前 ...

  10. 转-Spring单例模式与线程安全

    问题背景 这段时间在做项目的时候,考虑到Spring中的bean默认是单例模式的,那么当多个线程调用同一个bean的时候就会存在线程安全问题.如果是Spring中bean的创建模式为非单例的,也就不存 ...