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

📄 count1.cpp

📁 C语言命令行编程源代码
💻 CPP
字号:
// count1.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include "fstream.h"
#include "stdlib.h"
//#include "console.h"

int main(int argc, char* argv[])
{
	if(argc==1)
	{
		cerr<<"usage:"<<argv[0]<<"filename[s]\n";
		exit(1);
	}
	ifstream fin;
	ofstream fout("flash");

	long count;
	long total=0;
	char ch;
	if(fout.fail())
	{
		cerr<<" your bag is very heavy!";
		exit(1);

	}
	fout<<"***********************************";
	for(int file = 1; file <argc; file++)
	{
		fin.open("fat.bat");
		
		//_asm("XOR AL,AL");
		count=0;
		while(fin.get(ch))
			count++;
		cout<<count<<"characters in"<<"fat.bat"<<"\n";
		total+=count;
		fin.clear();
		fin.close();
	}
	cout<<total<<"character in all files\n";
	puts("END!");
	printf("Hello World!\n");
	return 0;
}

⌨️ 快捷键说明

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