//统计文件中25日要加班的日期,*的算X 2的天数
//7 25 2006
//5 25 2200*
//23 1 2000*
//.....
#include<iostream>
#include<iostream>
#include<sstream>
#include<fstream>
#include<string>
using namespace std;
void main()
{
int n(0);
ifstream in("C://aaa.txt");
for(string s;getline(in,s);)
{
cout<<s<<endl;
s.find(" 25 ")!=-1&&s.find('*')!=-1?n+=2:s.find(" 25 ")!=-1?n+=1:n=n;
cout<<n<<endl;
}
cout<<n<<endl;
}
本文介绍了一个简单的C++程序,用于统计文本文件中指定日期(25日)的加班记录,特别是标记为加倍(*2)的加班天数。程序通过读取文件内容,并查找包含‘25’和‘*’的行来实现这一功能。

被折叠的 条评论
为什么被折叠?



