5个回答

``````result = 10000*(2^(n-1))+1000*(2^(n-1)-1)

result = 11000*(2^(n-1))-1000
``````

``````#include <stdio.h>
int main()
{
int n;
scanf("%d", &n);
printf("%d", 11000*(1 << (n - 1))-1000);
}
``````
``````public int Travel(int num){
int Alllength=10000;
for(int i=1;i<num;i++){
Alllength+=Alllength*2+1000
}
return Alllength;
}
``````
``````public int Num(int N){
int DayNum=10000; //第一天走了多少米
int Num=DayNum;//N天走了多少米
for(int i=1;i<N;i++){
DayNum=DayNum*2+1000;// 第N天走了多少米
Num+=DayNum;//N天走了多少米
}
return Num;
}
``````

import java.util.Scanner;
public class Hello {
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
System.out.print("请输入行走天数：");
int countday=sc.nextInt();//行走天数
int i;//循环变量
long alllength=10000;//总的行走距离
long todaylength=alllength;//第几天走的距离,第1天走了10000米

``````    System.out.println(countday);
for (i=2;i<=countday;i++) {
todaylength=2*todaylength+1000;
alllength+=todaylength;
System.out.println(i+";"+todaylength+";"+alllength);
}
System.out.println("第"+countday+"天行走了"+todaylength+"米；一共走了"+alllength+"米");
}
``````

}

public static void main(String[] args) {
int x = 10000;
int t = 3;//设置天数
for(int i=1;i<t;i++)
{x=x*2+1000;}
System.out.println(t+"天走了"+x+"米");
}