1 import java.util.Scanner; 2 3 public class Main{ 4 public static void main(String args[]) { 5 Scanner sc=new Scanner(System.in); 6 while(true){ 7 int n=sc.nextInt(); 8 if(n==0) { 9 break; 10 } 11 int current=0; 12 int temp=0; 13 int tsum=0; 14 for(int i=0;i<n;i++) { 15 int end=sc.nextInt(); 16 if(end>temp) { 17 tsum=tsum+(end-temp)*6+5; 18 } 19 else { 20 tsum=tsum+(temp-end)*4+5; 21 } 22 temp=end; 23 } 24 System.out.println(tsum); 25 } 26 } 27 }
Elevator
免责声明:文章转载自《Elevator》仅用于学习参考。如对内容有疑问,请及时联系本站处理。
上篇haproxy2.0入门部署教程解决confluence的乱码问题下篇
宿迁高防,2C2G15M,22元/月;香港BGP,2C5G5M,25元/月 雨云优惠码:MjYwNzM=