?? c16.cpp
字號:
// c16.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <iostream.h>
#include <iomanip.h>
long product( int n );
int main(int argc, char* argv[])
{
cout << "從二月份開始每月生產量為:\n";
int a = 2;
for ( int i = 2; i <= 12; i++ )
{
a = 2*a - 1;
cout << setw(2) << i << "月生產:" << setw(5) << a << endl;
}
return 0;
}
long product( int n )
{
if ( n == 1 )
return 2;
return 2 * product(n-1) - 1;
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -