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", ...
随机推荐
- linux常用命令 3
示例定义的 mytest或者test 用户 mygroup 用户组 cat /etc/group 查看组 groupname:x:groupId:其他成员 组名:x(加密):组ID:组成员cat /e ...
- repo安装
repo是使用python开发的一个用于多版本管理的工具,可以和git协作,简化git的多版本管理. repo安装: 1.新建~/bin,并将此目录包含在path变量中(如果已存在,且已在path变量 ...
- [Flex] ButtonBar系列——flex3 ButtonBar样式之颜色的填充
<?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="h ...
- ElasticSearch 的 聚合(Aggregations)
Elasticsearch有一个功能叫做 聚合(aggregations) ,它允许你在数据上生成复杂的分析统计.它很像SQL中的 GROUP BY 但是功能更强大. Aggregations种类分为 ...
- ContextLoaderListener与DispatcherServlet所加载的applicationContext的区别
spring通过在web.xml 中配置ContextLoaderListener 来加载context配置文件,在DispatcherServlet中也可以来加载spring context配置文件 ...
- (easy)LeetCode 263.Ugly Number
Write a program to check whether a given number is an ugly number. Ugly numbers are positive numbers ...
- (easy)LeetCode 205.Isomorphic Strings (*)
Given two strings s and t, determine if they are isomorphic. Two strings are isomorphic if the chara ...
- Altera SoC 内核更新3.7到3.10
为什么需要更新呢?其实是为了更好的搭建自己的开发环境,同时熟悉altera对代码的更新和管理方式,便于进一步的熟悉和了解altera SoC开发过程. 1.下载linux代码: git clone ...
- Microsoft Office 2007的ContentType
当从浏览器返回一个文件时,需要指定ContentType,以下是Office2007对应的值: "application/vnd.openxmlformats-officedocument. ...
- JQuery基础教程:选择元素(下)
DOM遍历方法 利用前面介绍的jQuery选择符取得一组元素,就像是我们在DOM树中纵横遍历再经过筛选得到的结果一样.如果只有这一种取得元素的方式,那我们选择的余地从某个角度讲也是很有限的.很多情 ...