#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.

点击打开链接

算法

最新文章

  1. VS2010 使用时选择代码或双击时出错,点击窗口按钮后VS自动重启问题
  2. NYOJ-85 有趣的数 AC 分类: NYOJ 2014-01-17 21:42 240人阅读 评论(0) 收藏
  3. jQuery实现 浏览器后退到上次浏览位置
  4. java中Arrays类中,binarySearch()方法的返回值问题
  5. matlab实现不动点迭代、牛顿法、割线法
  6. css3:user-select属性
  7. 微信分享jssdk config:invalid signature 签名错误
  8. appium简明教程
  9. SparkMLlib回归算法之决策树
  10. POJ1743:Musical Theme
  11. 《深入理解JAVA虚拟机》笔记1
  12. 线段树(区间树)之区间染色和4n推导过程
  13. filter以及reduce的用法
  14. java基础 ---- 练习for循环
  15. jQuery的事件,动画效果等
  16. 有趣的线段树模板合集(线段树,最短/长路,单调栈,线段树合并,线段树分裂,树上差分,Tarjan-LCA,势能线段树,李超线段树)
  17. rabbitmq install erlang faild
  18. topcoder srm 390 div1
  19. matlab学习(2) sort、sortrows
  20. nc 命令使用详解

热门文章

  1. 完美演绎DevExpress XtraPrinting Library 的打印功能
  2. PHP 对于 MYSQL 基础操作
  3. mSites and Smarty
  4. 关于Task的线程窃取
  5. git的理解
  6. matlab中的卷积——filter,conv之间的区别
  7. JavaScript学习笔记-随滚轮匀速滑动的浮动广告窗动画
  8. xshell4|5远程连接工具
  9. Ceph Zabbix plugin 插件和模板
  10. jQuery基础--样式篇(4)