CPP
cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#include <iostream>
#include <math.h>
#include <list>
using namespace std;
int main()
{
string a[] = {"7.51", "12.03", "12.32", "17.06"};
list<int> secondesListe;
for(int i = 0; i < sizeof(a)/sizeof(*a); i++)
{
string s = a[i];
string delimiter = ".";
size_t pos = 0;
string heures;
while ((pos = s.find(delimiter)) != string::npos)
{
heures = s.substr(0, pos);
s.erase(0, pos + delimiter.length());
}
string minutes = s;
int h = stoi(heures);
int m = stoi(minutes);
int sec = h * 3600 + m * 60;
secondesListe.push_back(sec);
}
int maxValue = secondesListe.size();
int totalValue = 0;
int temp = 0;
Enter to Rename, Shift+Enter to Preview
OUTPUT
Run