⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 2017.txt

📁 北大ACM题目例程 详细的解答过程 程序实现 算法分析
💻 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 + -