using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace 流程控制
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button3_Click(object sender, EventArgs e)
{
int n = 0;
n = Convert.ToInt32(textBox1.Text);
int count = 1;//剩余的桃子
for (int i = 1; i <= n; i++)
{
count = (count + 1) * 2;//这就是吃之前的数
}
Console.WriteLine(count);
}
}
}