73_猿が桃を食べます

#include<iostream>
#include<stdio.h>
using namespace std;
int main()
{
    int N;
    cin>>N;
    int peach=1;
    while(--N){
        peach = peach+1;
        peach = peach*2;
    }
    cout<<peach;
    return 0;
}

 

公開された37元の記事 ウォンの賞賛4 ビュー1913

おすすめ

転載: blog.csdn.net/qq_41440031/article/details/104356788