/*杭电ACM ID:2007*/
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
int main()
{
int in1, in2, out1, out2;
int temp = 0, min, max;
while (scanf("%d %d", &in1, &in2) != EOF){
if (in1 < in2){
min = in1;
max = in2;
}
else{
min = in2;
max = in1;
}
temp = min;
out1 = 0;
out2 = 0;
for (; temp <= max; temp++){
if (temp % 2 == 0){
out1 += temp*temp;
}
else{
out2 += temp*temp*temp;
}
}
printf("%d %d\n", out1, out2);
}
}

  是否正确有待验证

HDU 2007的更多相关文章

  1. HDU 2007 (水)

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2007 题目大意:给你段连续数字,让你求 all sum of (偶数2 )and all sum of ...

  2. hdu 2007 - 平方和与立方和

    题目大意: 给定一段连续的整数,求出他们中所有偶数的平方和以及所有奇数的立方和. 解答: 坑你没商量!要考虑输入数a,b的大小.如果a>b,需要交换a,b的值. 1: #include<s ...

  3. HDU(1853),最小权匹配,KM

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1853 Cyclic Tour Time Limit: 1000/1000 MS (Java/Other ...

  4. hdu 1853 最小费用流好题 环的问题

    Cyclic Tour Time Limit: 1000/1000 MS (Java/Others)    Memory Limit: 32768/65535 K (Java/Others) Tota ...

  5. 【并查集专题】【HDU】

    PS:做到第四题才发现 2,3题的路径压缩等于没写 How Many Tables Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65 ...

  6. hdu 1851(A Simple Game)(sg博弈)

    A Simple Game Time Limit: 1000/1000 MS (Java/Others)    Memory Limit: 32768/65535 K (Java/Others)Tot ...

  7. hdu 1856 More is better (并查集)

    More is better Time Limit: 5000/1000 MS (Java/Others)    Memory Limit: 327680/102400 K (Java/Others) ...

  8. hdu 1853 Cyclic Tour (二分匹配KM最小权值 或 最小费用最大流)

    Cyclic Tour Time Limit: 1000/1000 MS (Java/Others)    Memory Limit: 32768/65535 K (Java/Others)Total ...

  9. HDU 1853 Cyclic Tour[有向环最小权值覆盖]

    Cyclic Tour Time Limit: 1000/1000 MS (Java/Others)    Memory Limit: 32768/65535 K (Java/Others)Total ...

随机推荐

  1. dedecms /include/helpers/archive.helper.php SQL Injection Vul

    catalog . 漏洞描述 . 漏洞触发条件 . 漏洞影响范围 . 漏洞代码分析 . 防御方法 . 攻防思考 1. 漏洞描述 Dedecms会员中心注入漏洞 Relevant Link: http: ...

  2. 关于 SSV-ID: 4474 POC的分析和思考

    SSV-ID: 4474 SSV-AppDir: Discuz!漏洞 发布时间: 2008-11-21 (GMT+0800) URL:http://sebug.net/vuldb/ssvid-4474 ...

  3. RabbitMQ安装配置

    安装RabbitMQ windows下的安装是非常简单的,我们需要准备两个东西 erlang的环境  下载windows和与之对象的操作系统位数安装包 http://www.erlang.org/do ...

  4. django1.8 提示(1_8.W001) The standalone TEMPLATE_* settings were deprecated in Django 1.8 and the TEMPLATES dictionary takes precedence. You must put the values of the following settings into your defau

    原因是升级之后不推荐使用单独的 TEMPLATES_DIR这样的设置了,使用TEMPLATE = []这种就好了 详细见https://openedx.atlassian.net/browse/TNL ...

  5. CentOS 6 日期 时间,时区,设置修改及时间同步

    一.时区 显示时区 date --help 获取帮助 date -R date +%z 上面两个命令都可 [root@localhost ~]# date -R; date +%z Fri, 19 O ...

  6. SQLite的WAL机制

    标注:本文部分有黏贴这里的资料,另外还加了一些自己的笔记 使用CoreData或者SQLite3的时候,我们创建的数据库, 在存储的文件夹中有三个文件:分别为:**.sqlite  **.sqlite ...

  7. Docker distrubution in django

    https://www.syncano.io/blog/configuring-running-django-celery-docker-containers-pt-1/ Update: Fig ha ...

  8. app中Webview实现下载表格

    <script type="text/javascript"> function getUrl(){ var close = confirm("请点击确定下载 ...

  9. 单个pdf提取测试

    # -*- coding: utf-8 -*- """ Created on Wed Feb 3 09:32:22 2016 pdf单个文件提取测试 @author: A ...

  10. Java http方式提交短信到短信网关

    URL url = new URL("短信网关url"); 一般短信内容需要用URLEncoder.encode()编码一下 HttpURLConnection httpCon = ...