Merge lp:~yani-kathy/marathon/imp-timereport into lp:marathon

Proposed by Katherine Zaoral (Vauxoo)
Status: Merged
Merged at revision: 30
Proposed branch: lp:~yani-kathy/marathon/imp-timereport
Merge into: lp:marathon
Diff against target: 71 lines (+5/-13)
2 files modified
time_report/in.txt (+4/-0)
time_report/time.cpp (+1/-13)
To merge this branch: bzr merge lp:~yani-kathy/marathon/imp-timereport
Reviewer Review Type Date Requested Status
Katherine Zaoral (Vauxoo) (community) Approve
Review via email: mp+190684@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Katherine Zaoral (Vauxoo) (kathy-zaoral) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'time_report/a.out'
2Binary files time_report/a.out 2013-10-11 00:49:49 +0000 and time_report/a.out 2013-10-11 14:24:07 +0000 differ
3=== modified file 'time_report/in.txt'
4--- time_report/in.txt 2013-10-10 23:57:35 +0000
5+++ time_report/in.txt 2013-10-11 14:24:07 +0000
6@@ -8,4 +8,8 @@
7 08/11/1994 00:45:00
8 04/04/1995 14:00:00
9 03/22/1995 14:00:00
10+2
11+10/11/2013 08:30:00
12+10/11/2013 08:30:00
13+01/01/1970 00:00:00
14 0
15
16=== modified file 'time_report/time.cpp'
17--- time_report/time.cpp 2013-10-11 00:49:49 +0000
18+++ time_report/time.cpp 2013-10-11 14:24:07 +0000
19@@ -12,7 +12,7 @@
20 int Anio, Mes, Dia, Hora, Min, Seg;
21 int a, me, d, h, mi, s;
22
23- int timestamp;
24+ unsigned int timestamp;
25 int m_s = 60;
26 int m_mi = m_s*60;
27 int m_h = m_mi*24;
28@@ -23,7 +23,6 @@
29 int fs_mi = 60, fs_h = 60*60, fs_d = 24*60*60, fs_me = 30*24*60*60, fs_a = 365*24*60*60;
30
31 cin >> num;
32-
33 while(num != 0){
34 cin >> fecha;
35 cin >> hora;
36@@ -31,7 +30,6 @@
37 sscanf(hora.c_str(),"%d%*c%d%*c%d",&Hora,&Min,&Seg);
38
39 //cout << "Dia: " << Dia << " Mes: " << Mes << " Anio " << Anio << endl;
40-
41 //cout << num << endl << fecha << " " << hora << endl;
42
43 for(int i = 0; i < num; i++){
44@@ -55,7 +53,6 @@
45 cout << ", Minutos " << mi;
46 cout << ", Segundos " << s;
47
48-
49 timestamp = s + mi*fs_mi + h*fs_h + d*fs_d + me*fs_me + a*fs_a;
50
51 cout << ", timestamp in sec: " << timestamp;
52@@ -68,19 +65,10 @@
53 else if(timestamp < m_mo){ unit = "month"; timestamp /= fs_me; }
54 else{ unit = "year"; timestamp /= fs_a; }
55
56- //if(timestamp >= m_y){ timestamp /= m_y; unit="year";
57- //}else if(timestamp > m_mo){ timestamp /= m_mo; unit = "year";
58- //}else if(timestamp > m_w){ timestamp /= m_w; unit = "month";
59- //}else if(timestamp > m_d){ timestamp /= m_d; unit = "week";
60- //}else if(timestamp > m_h){ timestamp /= m_h; unit = "day";
61- //}else if(timestamp > m_mi){ timestamp /= m_mi; unit = "hour";
62- //}else if(timestamp >= m_s){ timestamp /= m_s; unit = "minute";
63- //}else { unit = "second";}
64 if (timestamp > 1){
65 unit += "s";
66 }
67 cout << ", res: " << timestamp << " " << unit << " ago"<< endl;
68-
69 }
70 cin >> num;
71 }

Subscribers

People subscribed via source and target branches

to all changes: