⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 c63.cpp

📁 此文件可以能帮你求体积
💻 CPP
字号:
// c63.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include <fstream.h>

int main(int argc, char* argv[])
{

#if 0
	ofstream out( "text1.txt" );
	if ( !out )
	{
		cout << "Cannot open text1.txt file\n";
		return -1;
	}

	out << "Radios " << 39.95 << endl;
	out << "Toastens " << 19.95 << endl;
	out << "Mixers " << 24.80 << endl;
#else
	ifstream in( "text1.txt" );
	if ( !in )
	{
		cout << "Cannot open text1.txt file.\n";
		return -1;
	}

	char item[20];
	float cost;
	cout.precision( 2 );

	in >> item >> cost;
	cout << item << " " << cost << endl;
	
	in >> item >> cost;
	cout << item << " " << cost << endl;

	in >> item >> cost;
	cout << item << " " << cost << endl;

#endif

	return 0;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -