📄 2017.txt
字号:
import java.util.*;
public class Main {
static public void main( String [] string ) throws Exception{
Scanner cin = new Scanner( System.in );
int n, x, y, sum, t;
while( true ){
sum = t = 0;
n = cin.nextInt();
if( n < 0 )
break;
while( n-- > 0 ) {
x = cin.nextInt();
y = cin.nextInt();
sum += (y-t)*x;
t = y;
}
System.out.println( sum + " miles" );
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -