POJ 2140
#include<iostream>
#include<stdio.h>
using namespace std; int main()
{
int num;
int i;
int j;
int sum;
int ans;
cin>>num;
sum = ;
ans = ;
for(j = ; j <= num/; ++ j)
{
sum = ;
for(i = j; i <= num/ + ; ++ i)
{
sum += i;
if(sum > num)
break;
else if(sum == num)
{
++ ans;
} }
}
cout<<ans + <<endl;
}
关注我的公众号,当然,如果你对Java, Scala, Python等技术经验,以及编程日记,感兴趣的话。

技术网站地址: vmfor.com
POJ 2140的更多相关文章
- POJ 2140 Herd Sums
http://poj.org/problem?id=2140 Description The cows in farmer John's herd are numbered and branded w ...
- Poj 2853,2140 Sequence Sum Possibilities(因式分解)
一.Description Most positive integers may be written as a sum of a sequence of at least two consecuti ...
- poj 题目分类(1)
poj 题目分类 按照ac的代码长度分类(主要参考最短代码和自己写的代码) 短代码:0.01K--0.50K:中短代码:0.51K--1.00K:中等代码量:1.01K--2.00K:长代码:2.01 ...
- POJ题目分类(按初级\中级\高级等分类,有助于大家根据个人情况学习)
本文来自:http://www.cppblog.com/snowshine09/archive/2011/08/02/152272.spx 多版本的POJ分类 流传最广的一种分类: 初期: 一.基本算 ...
- POJ题目细究
acm之pku题目分类 对ACM有兴趣的同学们可以看看 DP: 1011 NTA 简单题 1013 Great Equipment 简单题 102 ...
- 【转】POJ百道水题列表
以下是poj百道水题,新手可以考虑从这里刷起 搜索1002 Fire Net1004 Anagrams by Stack1005 Jugs1008 Gnome Tetravex1091 Knight ...
- 转载:poj题目分类(侵删)
转载:from: POJ:http://blog.csdn.net/qq_28236309/article/details/47818407 按照ac的代码长度分类(主要参考最短代码和自己写的代码) ...
- poj和hdu部分基础算法分类及难度排序
最近想从头开始刷点基础些的题,正好有个网站有关于各大oj的题目分类(http://www.pythontip.com/acm/problemCategory),所以写了点脚本把hdu和poj的一些题目 ...
- POJ 3370. Halloween treats 抽屉原理 / 鸽巢原理
Halloween treats Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 7644 Accepted: 2798 ...
随机推荐
- 批处理判断是否存在文件,存在则运行另外一个bat文件
现在需求如下: 使用bat文件判断是否存在ktr文件,存在则运行pan.bat,执行kettle脚本. 代码如下: @echo off @title 批处理判断文件夹是否存在 cd /d F: rem ...
- oracle 临时表空间
环境: OS: Oracle Linux Server release 5.7 DB: Oracle Database 11g Enterprise Edition Release 11.2.0.3. ...
- 记录一下mvc发布
让别人也可以访问你电脑上的ASP.NET MVC创建的网站 http://www.cnblogs.com/laoqi/p/4169184.html
- Xcode7免证书真机调试实践
1.Open Xcode7, click menu "Xcode-Preferences-accounts" to add your AppleId; 2.According to ...
- HTML a 标签 下载 apk 文件
代码: <a href="http://www.abc2016.com/phone_Client/shouji.apk" class="download_inp ...
- VC++编程中获取系统时间
<span style="white-space:pre"> </span>总结了在程序中如何获得系统时间的方法 void CGetSystenTimeDl ...
- 字符串比较 忽略大小写 iphone
//不考虑大小写比较字符串1 NSString *astring01 = @"this is a String!"; NSString *astring02 = @"Th ...
- mysql使用二进制日志恢复数据
一.恢复到某个二进制文件 1.开启二进制日志 在mysqld的配置节点下添加如下配置 log-bin="E:/Mysql57BinLog/binlog"(windows下的路径,l ...
- Ombrophobic Bovines - POJ 2391
Description FJ's cows really hate getting wet so much that the mere thought of getting caught in the ...
- SQL 语法 Join与Union
问题描述: Join与Union使用 问题解决: Join连接,可以分为: tableA如下: tableB如下: 1.1.Inner Join SELECT * FROM TableA INNER ...