Multiples of 3 and 5
#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的更多相关文章
- 【算法题】Multiples of 3 and 5
Multiples of 3 and 5 原题 题意如下: 找出N以内的3和5的倍数的和. 思路 1.刚看到觉得好弱智,直接遍历一遍不就OK了吗?但是第2和第3个测试用例报了TLE,超时. 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 ...
- (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 ...
- Problem 1: Multiples of 3 and 5
小白一枚,python解法,共同学习,一起进步. Problem 1: Multiples of 3 and 5 If we list all the natural numbers below 10 ...
- 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 ...
- 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. ...
- 【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 ...
- LightOJ--1149--Factors and Multiples(二分图好题)
Factors and Multiples Time Limit: 2000MS Memory Limit: 32768KB 64bit IO Format: %lld & %llu ...
- Factors and Multiples
Factors and Multiples PDF (English) Statistics Forum Time Limit: 2 second(s) Memory Limit: 32 MB Y ...
随机推荐
- android studio 使用问题 解决方法
1. Error:Execution failed for task ':app:transformClassesWithDexForDebug'. > com.android.build.ap ...
- hadoop: hbase1.0.1.1 伪分布安装
环境:hadoop 2.6.0 + hbase 1.0.1.1 + mac OS X yosemite 10.10.3 安装步骤: 一.下载解压 到官网 http://hbase.apache.org ...
- 【讲义提纲】以一个实战新闻cms增删改查demo为例,给学院国创队伍培训php
PHP实战基础——以一个新闻cms的增删改查为例 一. 环境配置 二. 数据库创建 三. 增删改查demo 连接数据库 <?php $link=mysq ...
- 各地IT薪资待遇讨论
作为一个搞.net开发的程序员,在北京混了三年半,最近准备辞职到上海找工作.由于对上海的IT行业还不是很了解,在这里想让上海的同行们说下你们的情况,以方便我对自己在上海的定位,当然,其余城市的的同行们 ...
- redis性能测试tcp socket and unix domain
UNIX Domain Socket IPC socket API原本是为网络通讯设计的,但后来在socket的框架上发展出一种IPC机制,就是UNIX Domain Socket.虽然网络socke ...
- matlab中的xcorr 自相关函数
转载自 http://blog.163.com/to_be_myself/blog/static/176060227201101762159227/ Matlab中用于计算自相关函数的指令是xcorr ...
- 71 fdisk-Linux 的磁盘分区表操作工具。
语法: fdisk [-l] 装置名称 选项与参数: -l :输出后面接的装置所有的分区内容.若仅有 fdisk -l 时, 则系统将会把整个系统内能够搜寻到的装置的分区均列出来. 实例 列出所有分区 ...
- Android 拍照或者从相册获取图片的实现
我们常常会用到上传头像,或者发帖子的时候选择本地图片上传的功能.这个很常见 今天因为app的需求我研究了下.现在分享下. 其实不论是通过拍照还是从相册选取都会用到Intent 这是系统提供给我们用来调 ...
- Volley用法
RequestQueue requestQueue = Volley.newRequestQueue(this); JsonObjectRequest jsonObjectRequest = new ...
- Android AlertDialog
在Android 4.2 中不推荐使用showDialog弹窗,这里简单总结一下AlertDialog的使用方法,以后复习的时候看着方便,详细使用方法需要的时候再研究. setTitle :为对话框设 ...