poj2017
一天两个题,凑数用的大水题啊。。。不解释了。。羞愧ing
#include <stdio.h>
int main(){
int t;
int i;
int a[],b[],tot;
while(~scanf("%d",&t)&&t!=-){
tot=;
for(i=;i<t;++i){
scanf("%d%d",&a[i],&b[i]);
if(i==)
tot+=a[i]*b[i];
else
tot+=a[i]*(b[i]-b[i-]);
}
printf("%d miles\n",tot);
}
return ;
}
poj2017的更多相关文章
- poj2017简单题
#include <stdio.h> #include <stdlib.h> int main() { int n,i; while(scanf("%d", ...
随机推荐
- js方法收藏
1.验证非负数字 //onfocusout="checkQty(this);" function checkQty(obj) { //排除0开头的非法输入 if (obj.valu ...
- OAuth2.0_豆瓣登录_API错误返回码说明一览表[转]
转自: http://blog.unvs.cn/archives/douban-oauth-2.0-error_code.html 在遵循OAuth2.0协议,开始制作豆瓣过程中,经常会遇到以下两个错 ...
- c语言中的二分法
\\\题外:对于printf引号中的内容一定要细心书写 ; 数组由a[0]开始计数,切记:尤其是与for循环中i=1 搞混 运用a[i+1]等超前数据时 需先用 for(i=0;i<=n-1;i ...
- ndk android studio万年坑
先说javah万年坑 javah语法: Usage: javah [options] <classes> where [options] include: -o <file> ...
- Nexus配置
1.可以为maven项目单独配置nexus路径 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi=&q ...
- 解决dedev5.7更新出现include\userlogin.class.php on line 21的办法
第一种情况解决办法: 在dede\templets文件夹 找到 index_body.htm 文件 把这些注释掉. $(function() { $.get("index_tes ...
- gomoblie flappy 源码分析:游戏逻辑
本文主要讨论游戏规则逻辑,具体绘制技术请参看相关文章: gomoblie flappy 源码分析:图片素材和大小的处理 http://www.cnblogs.com/ghj1976/p/5222289 ...
- Hibernate 实体关联关系映射【转】
Hibernate关联关系映射目录│ ├─单向关联│ ├─ 一对一外键单向关联│ ├─ 一对一主键单向关联│ ├─ 一对一连接表单向关联│ ├─ 一对多外键单向关联│ ├─ 一对多 ...
- 蓝桥杯---剪格子(DFS&BFS)(小总结)
问题描述 如下图所示,3 x 3 的格子中填写了一些整数. +--*--+--+ |10* 1|52| +--****--+ |20|30* 1| *******--+ | 1| 2| 3| +--+ ...
- hitTest方法与PointInside方法
*:first-child { margin-top: 0 !important; } body > *:last-child { margin-bottom: 0 !important; } ...