Skip to content

Commit 5e580a0

Browse files
committed
Fixed scorers and anagrams, added clockhands
1 parent 039812d commit 5e580a0

File tree

3 files changed

+22
-4
lines changed

3 files changed

+22
-4
lines changed

cpp/anagrams.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#include <cstring>
12
#include <iostream>
23
#include <utility>
34

cpp/clockhands.cpp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#include <iomanip>
2+
#include <iostream>
3+
using namespace std;
4+
5+
int main() {
6+
for (auto i = 0; i < 11; i++) {
7+
int t = (43200 * i + 21600) / 11;
8+
int h = t / 3600, m = t / 60 % 60, s = t % 60;
9+
cout << setfill('0')
10+
<< setw(2) << (h ? h : 12)
11+
<< ':' << setw(2) << m
12+
<< ':' << setw(2) << s
13+
<< endl;
14+
}
15+
return 0;
16+
}

cpp/top_ten_scorers.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
#include <iostream>
1+
#include <algorithm>
22
#include <fstream>
3-
#include <vector>
4-
#include <string>
3+
#include <iomanip>
4+
#include <iostream>
55
#include <sstream>
6-
#include <algorithm>
6+
#include <string>
7+
#include <vector>
78

89
struct Player {
910
std::string name;

0 commit comments

Comments
 (0)