C++ 文件和流

C++ 文件和流
到目前为止,我们已经使用了 iostream 标准库,它提供了 cin 和 cout 方法分别用于从标准输入读取流和向标准输出写入流。

 1 #include <iostream>
 2 #include <iomanip>
 3 /* run this program using the console pauser or add your own getch, system("pause") or input loop */
 4 using namespace std;
 5 int main(int argc, char** argv) {
 6     int i;
 7     int f[20]={1,1};
 8     for(i=2;i<20;i++)
 9     f[i]=f[i-2]+f[i-1];
10     for(i=0;i<20;i++)
11     {
12         if(i%5==0)cout <<endl;
13         cout <<setw(8)<<f[i];
14     }
15     cout <<endl;
16     return 0;
17 }

猜你喜欢

转载自www.cnblogs.com/borter/p/9401259.html