file_10.cpp
来自「数据结构常用算法合集」· C++ 代码 · 共 18 行
CPP
18 行
//file_10.cpp
#include <fstream.h>
#include <conio.h>
#include <iomanip.h> //setw()
void main()
{ float d;
int degree;
char buffer[80];
ifstream infile("fdata.txt");
infile.getline(buffer,80); //读取标题字符串
cout << buffer << endl; //输出标题字符串
while (infile)
{ infile >> degree >> d; //读取角度与函数值
cout << setw(3)<< degree << " " <<d << endl; //输出
}
getch();
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?