C++统计博客园写过的代码行数

一、获得数据

1、备份到XML
2、改为txt

2、进行统计

#include<iostream>
#include<string>
using namespace std;
int main(){
	freopen("just.txt","r",stdin);
	string s;
	getline(cin,s);
	int flag = 0;  long long count = 0;
	while(s != "gwj494916494"){
		getline(cin,s);
		if(s.find("code") != string::npos)flag = !flag;
		if(flag)count++;
	}	
	cout<<count<<"
";
	return 0;
}

原文地址:https://www.cnblogs.com/gwj1314/p/12300299.html