posts - 183,  comments - 10,  trackbacks - 0
 
 1 def my_range(start, stop = None, step = 1):
 2     # 实现自己的 range
 3     if stop == None:
 4         start, stop = 0, start
 5 
 6     result = []
 7     if step > 0:
 8         i = start
 9         while i < stop:
10             result.append(i)
11             i += step
12     else:
13         i = start
14         while (i > stop):
15             result.append(i)
16             i += step
17     return result
18 
19 print(my_range(10))
20 print(my_range(5202))
21 print(my_range(110))
22 print(my_range(10, 0, -1))
23 print(my_range(100, 0, -9))

输出:
>>>
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
[5, 7, 9, 11, 13, 15, 17, 19]
[1, 2, 3, 4, 5, 6, 7, 8, 9]
[10, 9, 8, 7, 6, 5, 4, 3, 2, 1]
[100, 91, 82, 73, 64, 55, 46, 37, 28, 19, 10, 1]
posted @ 2013-05-16 21:00 unixfy 阅读(367) | 评论 (0)编辑 收藏
 1 def init(data):
 2     data['first'= {}
 3     data['middle'= {}
 4     data['last'= {}
 5 
 6 def lookup(data, label, name):
 7     return data[label].get(name)
 8 
 9 def store(data, full_name):
10     names = full_name.split()
11     if len(names) == 2:
12         names.insert(1'')
13     labels = 'first''middle''last'
14     for label, name in zip(labels, names):
15         people = lookup(data, label, name)
16         if people:
17             people.append(full_name)
18         else:
19             data[label][name] = [full_name]
20 
21 my_names = {}
22 init(my_names)
23 store(my_names, 'Magnus Lie Hetland')
24 print(my_names)
25 print(lookup(my_names, 'middle''Lie'))
26 
27 store(my_names, 'Robin Hood')
28 store(my_names, 'Robin Locksley')
29 print(my_names)
30 print(lookup(my_names, 'first''Robin'))
31 store(my_names, 'Mr. Gumby')
32 print(my_names)
33 print(lookup(my_names, 'middle'''))
34 

输出:
>>>
{'middle': {'Lie': ['Magnus Lie Hetland']}, 'first': {'Magnus': ['Magnus Lie Hetland']}, 'last': {'Hetland': ['Magnus Lie Hetland']}}
['Magnus Lie Hetland']
{'middle': {'': ['Robin Hood', 'Robin Locksley'], 'Lie': ['Magnus Lie Hetland']}, 'first': {'Robin': ['Robin Hood', 'Robin Locksley'], 'Magnus': ['Magnus Lie Hetland']}, 'last': {'Hetland': ['Magnus Lie Hetland'], 'Locksley': ['Robin Locksley'], 'Hood': ['Robin Hood']}}
['Robin Hood', 'Robin Locksley']
{'middle': {'': ['Robin Hood', 'Robin Locksley', 'Mr. Gumby'], 'Lie': ['Magnus Lie Hetland']}, 'first': {'Mr.': ['Mr. Gumby'], 'Robin': ['Robin Hood', 'Robin Locksley'], 'Magnus': ['Magnus Lie Hetland']}, 'last': {'Hetland': ['Magnus Lie Hetland'], 'Locksley': ['Robin Locksley'], 'Gumby': ['Mr. Gumby'], 'Hood': ['Robin Hood']}}
['Robin Hood', 'Robin Locksley', 'Mr. Gumby']


改进:利用收集参数,一次可以添加多个名字 strage_2
 1 def init(data):
 2     data['first'= {}
 3     data['middle'= {}
 4     data['last'= {}
 5 
 6 def lookup(data, label, name):
 7     return data[label].get(name)
 8 
 9 def store(data, full_name):
10     names = full_name.split()
11     if len(names) == 2:
12         names.insert(1'')
13     labels = 'first''middle''last'
14     for label, name in zip(labels, names):
15         people = lookup(data, label, name)
16         if people:
17             people.append(full_name)
18         else:
19             data[label][name] = [full_name]
20 
21 def store_2(data, *full_names):
22     for full_name in full_names:
23         names = full_name.split()
24         if len(names) == 2:
25             names.insert(1'')
26         labels = 'first''middle''last'
27         for label, name in zip(labels, names):
28             people = lookup(data, label, name)
29             if people:
30                 people.append(full_name)
31             else:
32                 data[label][name] = [full_name]
33 
34 my_names = {}
35 init(my_names)
36 store(my_names, 'Magnus Lie Hetland')
37 print(my_names)
38 print(lookup(my_names, 'middle''Lie'))
39 
40 store(my_names, 'Robin Hood')
41 store(my_names, 'Robin Locksley')
42 print(my_names)
43 print(lookup(my_names, 'first''Robin'))
44 store(my_names, 'Mr. Gumby')
45 print(my_names)
46 print(lookup(my_names, 'middle'''))

posted @ 2013-05-16 20:12 unixfy 阅读(212) | 评论 (0)编辑 收藏
1 def foo():
2     x = 5
3     for i in range(3):
4         print(i)
5 for i in range(1013):
6     print(i)
7 
8 foo()

输出:
>>>
10
11
12
0
1
2


1 def foo():
2     x = 5
3     for i in range(3):
4         print(i)
5     for i in range(1013):
6         print(i)
7 
8 foo()

输出:
>>>
0
1
2
10
11
12





posted @ 2013-05-16 19:54 unixfy 阅读(149) | 评论 (0)编辑 收藏
类似于C++中的引用计数
 1 >>> x = 5
 2 >>> y = x
 3 >>> x == y
 4 True
 5 >>> x is y
 6 True
 7 >>> y = 3
 8 >>> x == y
 9 False
10 >>> x is y
11 False

 1 >>> x = 5
 2 >>> y = x
 3 >>> x == y
 4 True
 5 >>> x is y
 6 True
 7 >>> y = 5
 8 >>> x == y
 9 True
10 >>> x is y
11 True
12 >>> y = 3
13 >>> x == y
14 False
15 >>> x is y
16 False


posted @ 2013-05-16 19:21 unixfy 阅读(72) | 评论 (0)编辑 收藏
 1 from math import sqrt
 2 
 3 def is_prim(n):
 4     if n < 2:
 5         return False
 6     for i in range(2, int(sqrt(n)) + 1):
 7         if n % i == 0:
 8             return False
 9     return True
10 
11 def get_prim(n):
12     if n < 1:
13         return None
14     x = 1
15     r = 3
16     ret = 2
17     while x < n:
18         if is_prim(r) == True:
19             x = x + 1
20             ret = r
21         r = r + 1
22     return ret
23 
24 = int(input("Input n: "))
25 print(get_prim(n))
26 
posted @ 2013-05-14 22:25 unixfy 阅读(866) | 评论 (0)编辑 收藏
 1 people = {
 2     'Alice' : {
 3         'phone' : '2341',
 4         'addr'  : 'Foo drive 23'
 5         },
 6     'Beth' : {
 7         'phone' : '9102',
 8         'addr'  : 'Bar street 42'
 9         },
10     'Cecil' : {
11         'phone' : '3158',
12         'addr'  : 'Baz avenue 90'
13         }
14     }
15 
16 labels = {
17     'phone' : 'phone number',
18     'addr'  : 'address'
19     }
20 
21 name = input("Name:")
22 
23 request = input("phone number(p) or address(a)?")
24 
25 if request == 'p' : key = 'phone'
26 if request == 'a' : key = 'addr'
27 
28 if name in people :
29     print("%s's %s is %s." % (name, labels[key], people[name][key]))
30 

get 函数,提供默认值
 1 people = {
 2     'Alice' : {
 3         'phone' : '2341',
 4         'addr'  : 'Foo drive 23'
 5         },
 6     'Beth' : {
 7         'phone' : '9102',
 8         'addr'  : 'Bar street 42'
 9         },
10     'Cecil' : {
11         'phone' : '3158',
12         'addr'  : 'Baz avenue 90'
13         }
14     }
15 
16 labels = {
17     'phone' : 'phone number',
18     'addr'  : 'address'
19     }
20 
21 name = input("Name:")
22 
23 request = input("phone number(p) or address(a)?")
24 
25 key = request
26 if request == 'p' : key = 'phone'
27 if request == 'a' : key = 'addr'
28 
29 person = people.get(name, {})
30 label  = labels.get(key, key)
31 result = person.get(key, 'not available')
32 
33 print("%s's %s is %s." % (name, label, result))
34 


posted @ 2013-05-12 22:50 unixfy 阅读(136) | 评论 (0)编辑 收藏
Box
 1 sentence = input("Sentence: ")
 2 
 3 screen_width = 80
 4 text_width   = len(sentence)
 5 box_width    = text_width + 6
 6 left_margin  = int((screen_width - box_width) / 2)
 7 
 8 print()
 9 print(' ' * left_margin + '+' + '-' * (box_width-4+ '+')
10 print(' ' * left_margin + '' + ' ' * text_width + ' |')
11 print(' ' * left_margin + '' + sentence + ' |')
12 print(' ' * left_margin + '' + ' ' * text_width + ' |')
13 print(' ' * left_margin + '+' + '-' * (box_width-4+ '+')
14 print()
15 
posted @ 2013-05-12 15:28 unixfy 阅读(115) | 评论 (0)编辑 收藏
《Python 基础教程》
 1 months = [
 2     'January',
 3     'February',
 4     'March',
 5     'April',
 6     'May',
 7     'June',
 8     'July',
 9     'August',
10     'September',
11     'October',
12     'November',
13     'December'
14     ]
15 
16 # print(month)
17 
18 endings = ['st''nd''rd'+ 17 * ['th'] \
19         + ['st''nd''rd'+ 7  * ['th'] \
20         + ['st']
21 
22 year  = input("Year: ")
23 month = input("Month: ")
24 day   = input("Day: ")
25 
26 month_number = int(month)
27 day_number   = int(day)
28 
29 month_name   = months[month_number-1]
30 ordinal      = day + endings[day_number-1]
31 
32 # print(1, 2, 3)
33 print(month_name + ' ' + ordinal + '' + year)
34 

posted @ 2013-05-12 14:05 unixfy 阅读(164) | 评论 (0)编辑 收藏
 

互联网上的商业模式

 

商业模式经济上、商业上的定义我不知道。我所理解的商业模式就是“赚钱的模式”。

“男怕入错行,女怕嫁错郎”,对于学计算机的人,想从事IT这个行业的人,以及正在这个行业工作的人都需要思考这个问题:互联网这个行业怎么样,它可以使这个行业的人能够实现自己的价值吗?

 

史玉柱说过网络游戏是目前中国互联网上最好的商业模式,这是他好多年前说的,但是到目前为止,这句话依然有效,目前中国互联网行业依然是互联网上最好的商业模式,目前虽然电子商务发展的很好,但是它是烧钱的而不是赚钱,这种烧钱模式不知道会持续多久。

目前中国几大互联网公司,虽然其主营业务看起来不是网络游戏,但是实质上都是以网络游戏生存着的。腾讯是中国互联网上收入最多的公司,其游戏收入比重占了一半以上,网易有一半以上的收入也是来自网络游戏,搜狐畅游、盛大、金山、人人等。

 

百度不是靠游戏为生的,竞价排名是一直被人所诟病的,排除广告的因素,竞价排名确实是一种很好的赚钱模式,使得百度收入逐年增高。

 

360 是一家很好的公司,其倡导免费模式,在推出了安全浏览器和网址导航后开始了一些盈利。

现在很多人的观点是一定要先免费,增加用户量,用户上去了自然而然就会有赚钱模式。我并不认同这种观点,因为并不是每个人都是周鸿祎,在你用户还没上去之前你的公司可能早已经死了,所以别人可以做的事,并不代表你可以做。别人可以先做用户量,别人可以拿到天使投资、风险投资,而你并不一定拿到。

最保险的方法就是在你的公司初创时期就考虑怎么赚钱,怎么能生成下去。

 

视频网站也是中国互联网上一个比较打的模式,视频网站也是很烧钱,现在优酷做起来了,开始有了自己的广告、收费视频节目、自制的一些节目(晓说、潘石屹、财经类等),但是中国互联网上也尽只有优酷、爱奇艺、搜狐视频等几家公司。

 

电子商务被很多人看好,已经迅猛发展很多年了。前几天的双11淘宝-天猫销售额达到191亿,这个数字是庞大的。

目前国内电子商务模式主要有三种:阿里的平台式;京东、亚马逊、一号店、当当等这种沃尔玛、国美式;还有一种是自做品牌的如凡客、乐淘等。在我看来,这三种模式更看好平台式的,电子商务的精髓在于电子,而非商务,因为商务早就存在,所以没有必要再创造出一个新的电子的品牌。能够体现电子的,就是让线下的东西能够通过电子的方式销售,而淘宝-天猫就是做的这个。

 

计算机发展到现在,在我看来主要是三个部分:硬件、软件、互联网。比尔盖茨的软件模式是一个非常好的模式,一直到现在为止依然是微软、甲骨文这些公司。

 

关于风险投资,我想风险投资是随着计算机互联网发展起来的,如果一家创始人从创办开始就可以自负盈亏、赢利,那么它为什么要为了一点资金而稀释自己的股份,风投之所以伴随着互联网的发展是因为互联网公司一开始就没有造血的功能,需要不断的供血,不断的供血,知道能够上市或者被收购,这样给风投者以巨大的回报。

我个人并不看好这种模式,因为能够拉到风投不是一般人能为之的,另外,即便拉到风投成功的也很少,这不是一条理性的道路。

 

我理想的创业模式是那种传统软件的模式,一开始就可以自负盈亏,自己靠自己生存,和风投没有关系,按照自己的步调走。

/Files/unixfy/互联网上的商业模式_mark.doc

posted @ 2012-11-22 10:33 unixfy 阅读(140) | 评论 (0)编辑 收藏

统一的考勤处理程序

总共分为 6 个处理步骤,如下:
0. 进行考勤数据的预处理,其中有筛选打卡成功的记录,并对成功的记录进行排序。这一步比较灵活,根据不同的考勤数据做不同的预处理以得到后续可以处理的数据。
1. 针对打卡成功的考勤记录,找出每天的最早时间和最晚时间。
2. 根据最早时间和最晚时间得到迟到和早退记录。
3. 由于可能存在缺勤的情况,所以需要在制定工作日内找到未存在考勤记录的记录,作为缺勤记录。
4. 将前面的迟到和早退记录与缺勤记录进行整合。
5. 根据整合的结果输出考勤异常的记录。输出有多种形式,前面的迟到、早退、缺勤等数据一定了,这里的输出格式可以按照:按人名-行输出、按人名-列输出、按日期-行输出、按日期-列输出、人名-日期输出、日期-人名输出等多种方式。

具体的程序实现如下:
0.
#include <iostream>
#include <fstream>
#include <sstream>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;

int main()
{
 ifstream fin_kaoqin("kaoqin.txt");
 ofstream fout_0("0.txt");
 if (!fin_kaoqin || !fout_0)
 {
  cerr << "File error!" << endl;
  system("PAUSE");
  exit(1);
 }
 vector<string> checkins;
 string name, date, time;
 string s1, s2, s3, ind;
 string line;
 while (getline(fin_kaoqin, line))
 {
  istringstream sin(line);
  sin >> s1 >> s2 >> name >> date >> time >> s3 >> ind;
  if (ind != "成功")
  {
   continue;
  }
  checkins.push_back(name + '\t' + date + '\t' + time);
 }
 sort(checkins.begin(), checkins.end());
 for (vector<string>::size_type i = 0; i != checkins.size(); ++i)
 {
  fout_0 << checkins[i] << endl;
 }
 fin_kaoqin.close();
 fout_0.close();
 return 0;
}

1.
#include <iostream>
#include <fstream>
#include <sstream>
#include <map>
#include <set>
#include <vector>
#include <string>
using namespace std;

int main()
{
 ifstream fin("0.txt");
 ofstream fout("1.txt");
 ofstream fout_names("names.txt");
 ofstream fout_dates("dates.txt");
 if (!fin || !fout || !fout_names || !fout_dates)
 {
  cerr << "File error!" << endl;
  system("PAUSE");
  exit(1);
 }
 map<string, vector<string> > checkins;
 set<string> names, dates;
 string line;
 string name, date, time;
 while (getline(fin, line))
 {
  istringstream sin(line);
  sin >> name >> date >> time;
  names.insert(name);
  dates.insert(date);
  checkins[name + '\t' + date].push_back(time);
 }
 string earliest, lastest;
 for (map<string, vector<string> >::const_iterator cit = checkins.begin(); cit != checkins.end(); ++cit)
 {
  earliest = lastest = cit->second[0];
  for (vector<string>::size_type i = 0; i != cit->second.size(); ++i)
  {
   if (earliest > cit->second[i])
   {
    earliest = cit->second[i];
   }
   else if (lastest < cit->second[i])
   {
    lastest = cit->second[i];
   }
  }
  fout << cit->first << '\t' << earliest << endl;
  fout << cit->first << '\t' << lastest  << endl;
 }
 for (set<string>::const_iterator cit = names.begin(); cit != names.end(); ++cit)
 {
  fout_names << *cit << endl;
 }
 for (set<string>::const_iterator cit = dates.begin(); cit != dates.end(); ++cit)
 {
  fout_dates << *cit << endl;
 }
 fin.close();
 fout.close();
 fout_names.close();
 fout_dates.close();
 return 0;
}

2.
#include <iostream>
#include <fstream>
#include <sstream>
#include <string>
using namespace std;

struct checkin
{
 string name;
 string date;
 string time;
};

void foo(ofstream& fout_nor, ofstream& fout_abn, const checkin& ci1, const checkin& ci2, const string& start, const string& end)
{
 if (ci1.time <= start)
 {
  fout_nor << ci1.name << '\t' << ci1.date << '\t' << ci1.time << endl;
 }
 else
 {
  fout_abn << ci1.name << '\t' << ci1.date << '\t' << ci1.time << "迟到" << endl;
 }
 if (ci2.time >= end)
 {
  fout_nor << ci2.name << '\t' << ci2.date << '\t' << ci2.time << endl;
 }
 else
 {
  fout_abn << ci2.name << '\t' << ci2.date << '\t' << ci2.time << "早退" << endl;
 }
}

int main()
{
 ifstream fin("1.txt");
 ofstream fout_nor("2-normal.txt"), fout_abn("2-abnormal.txt");
 if (!fin || !fout_nor || !fout_abn)
 {
  cerr << "File error!" << endl;
  system("PAUSE");
  exit(1);
 }
 string line1, line2;
 checkin ci1, ci2;
 string start = "083000", end = "173000";
 while (getline(fin, line1) && getline(fin, line2))
 {
  istringstream sin1(line1), sin2(line2);
  sin1 >> ci1.name >> ci1.date >> ci1.time;
  sin2 >> ci2.name >> ci2.date >> ci2.time;
  foo(fout_nor, fout_abn, ci1, ci2, start, end);
 }
 fin.close();
 fout_nor.close();
 fout_abn.close();
 return 0;
}

3.
#include <iostream>
#include <fstream>
#include <sstream>
#include <string>
#include <map>
#include <set>
#include <vector>
using namespace std;

int main()
{
 ifstream fin_ci("0.txt");
 ifstream fin_name("names-filter.txt");
 ifstream fin_date("dates-filter.txt");
 ofstream fout_nowork("2.1-nowork.txt");
 if (!fin_ci || !fin_name || !fin_date || !fout_nowork)
 {
  cerr << "File error!" << endl;
  system("PAUSE");
  exit(1);
 }
 map<string, set<string> > name_date;
 string line, name, date;
 while (getline(fin_ci, line))
 {
  istringstream sin(line);
  sin >> name >> date;
  name_date[name].insert(date);
 }
 vector<string> names;
 while (fin_name >> line)
 {
  names.push_back(line);
 }
 vector<string> dates;
 while (fin_date >> line)
 {
  dates.push_back(line);
 }
 for (vector<string>::size_type i = 0; i != names.size(); ++i)
 {
  for (vector<string>::size_type j = 0; j != dates.size(); ++j)
  {
   if (name_date[names[i]].find(dates[j]) == name_date[names[i]].end())
   {
    fout_nowork << names[i] << '\t' << dates[j] << '\t' << "无出勤记录!" << endl;
   }
  }
 }
 fin_ci.close();
 fin_name.close();
 fin_date.close();
 fout_nowork.close();
 return 0;
}

4.
#include <iostream>
#include <fstream>
#include <sstream>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;

int main()
{
 ifstream fin_abnormal("2-abnormal.txt");
 ifstream fin_nowork("2.1-nowork.txt");
 ofstream fout_excep("2.2-exception.txt");
 if (!fin_abnormal || !fin_nowork || !fout_excep)
 {
  cerr << "File error!" << endl;
  system("PAUSE");
  exit(1);
 }
 vector<string> checkins;
 string line;
 while (getline(fin_abnormal, line))
 {
  checkins.push_back(line);
 }
 while (getline(fin_nowork, line))
 {
  checkins.push_back(line);
 }
 sort(checkins.begin(), checkins.end());
 for (vector<string>::size_type i = 0; i != checkins.size(); ++i)
 {
  fout_excep << checkins[i] << endl;
 }
 fin_abnormal.close();
 fin_nowork.close();
 fout_excep.close();
 return 0;
}

5.
#include <iostream>
#include <fstream>
#include <sstream>
#include <string>
#include <map>
#include <set>
#include <vector>
using namespace std;

struct date_time
{
 string date;
 string time;
};

int main()
{
 ifstream fin_ci("2.2-exception.txt");
 ifstream fin_names("names-filter.txt");
 ifstream fin_dates("dates-filter.txt");
 ofstream fout_row("3-name-row-filter.txt");
 ofstream fout_col("3-name-column-filter.txt");
 if (!fin_ci || !fout_row || !fout_col || !fin_names || !fin_dates)
 {
  cerr << "File error!" << endl;
  system("PAUSE");
  exit(1);
 }
 map<string, vector<date_time> > bypers;
 vector<string> names;
 string line, name;
 date_time dt;
 int MAXNUM = 0;
 // 读取想要的人名
 set<string> names_filter;
 while (fin_names >> name)
 {
  names_filter.insert(name);
 }
 // 读取想要的日期
 set<string> dates_filter;
 while (fin_dates >> line)
 {
  dates_filter.insert(line);
 }
 while (getline(fin_ci, line))
 {
  istringstream sin(line);
  sin >> name >> dt.date >> dt.time;
  // 提取想要的人名和日期
  if (names_filter.find(name) == names_filter.end() || dates_filter.find(dt.date) == dates_filter.end())
  {
   continue;
  }
  bypers[name].push_back(dt);
 }
 // 同名字下相同日期的合并
 for (map<string, vector<date_time> >::iterator cit = bypers.begin(); cit != bypers.end(); ++cit)
 {
  // 提取名字
  names.push_back(cit->first);
  
  vector<date_time> tmp, hold = cit->second;
  vector<date_time>::size_type i = 0;
  while (i < hold.size() - 1)
  {
   if (hold[i].date == hold[i+1].date)
   {
    dt.date = hold[i].date;
    dt.time = hold[i].time + hold[i + 1].time;
    tmp.push_back(dt);
    i += 2;
   }
   else
   {
    dt.date = hold[i].date;
    dt.time = hold[i].time;
    tmp.push_back(dt);
    ++i;
   }
  }
  // 最后两个如果相等,那么 i 一下子回跳到 hold.size()。
  // 如果不相等,那么 i 变成 hold.size() - 1, 推出循环。
  // 也就是说推出循环有两种情况,分别是 i 为 hold.size() 和 hold.size() - 1
  // i 为 hold.size() 的情况没有遗漏记录,i 为 hold.size() - 1 遗漏了数据,所以在此补充。
  if (i == hold.size() - 1)
  {
   dt.date = hold[i].date;
   dt.time = hold[i].time;
   tmp.push_back(dt);
   ++i;
  }
  // 记录最大记录个数
  if (MAXNUM < tmp.size())
  {
   MAXNUM = tmp.size();
  }
  cit->second = tmp;
 }
 // 按行输出
 for (map<string, vector<date_time> >::const_iterator cit = bypers.begin(); cit != bypers.end(); ++cit)
 {
  fout_row << cit->first << '\t';
  for (vector<date_time>::size_type i = 0; i != cit->second.size(); ++i)
  {
   fout_row << cit->second[i].date << '\t' << cit->second[i].time << '\t';
  }
  fout_row << endl;
 }
 
 // 先输出人名
 for (vector<string>::size_type i = 0; i != names.size(); ++i)
 {
  fout_col << names[i] << '\t';
 }
 fout_col << endl;
 // 按列输出
 for (int i = 0; i != MAXNUM; ++i)
 {
  for (vector<string>::size_type j = 0; j != names.size(); ++j)
  {
   if (bypers[names[j]].size() > i)
   {
    fout_col << bypers[names[j]][i].date << ',' << bypers[names[j]][i].time << '\t';
   }
   else
   {
    fout_col /* << "XXXXXX" */ << '\t';
    // 这里的输出 "XXXXXX" 可以省略,即可以直接 fout_col << '\t';
   }
  }
  fout_col << endl;
 }
 fin_ci.close();
 fout_row.close();
 fout_col.close();
 return 0;
}

posted @ 2012-10-29 17:04 unixfy 阅读(148) | 评论 (0)编辑 收藏
仅列出标题
共19页: 1 2 3 4 5 6 7 8 9 Last