我想在北京买套房子

/*
*Copyright (c) 2013 ,烟台大学计算机学院
*All rights reserved.
*作者:张凤宁
*完成日期:2013年11月20
*版本号:v1.0
*问题描述:我想在北京买套房子
*样例输入:
*样例输出:
*问题分析:用简单的方法,学会活学活用
*/
#include <iostream>
#include <cmath>
using namespace std;

int main()
{
    int price,a,income,b,n;
    cin>>price>>a>>income;
    for(n=0; n<=20; n++)
    {
        b=price*pow((a+1),n);

        if (n<20)
            cout<<"N"<<endl;
        else
            cout<<"Y"<<endl;
    }
    return 0;
}
运行结果:

你可能感兴趣的:(我想在北京买套房子)