fork download
  1. #include <algorithm>
  2. #include<iostream>
  3. #include <set>
  4. using namespace std;
  5. void capital(char &ch) {
  6. if (ch >= 'a' && ch <= 'z') {
  7. ch = ch - 32;
  8. }
  9. }
  10. int main() {
  11. char start, end;
  12. cout << "from :" << endl;
  13. cin >> start;
  14. capital(start);
  15.  
  16. cout << "to :" << endl;
  17. cin >> end;
  18. capital(end);
  19. cout << "enter characters:" << endl;
  20. set<char> s;
  21. while (true) {
  22. char c;
  23. cin >> c;
  24. capital(c);
  25. if (c == '0')break;
  26. s.insert(c);
  27. }
  28. int count = 0;
  29. for (; start <= end; start++) {
  30. if (s.find(start) != s.end()) {
  31. continue;
  32. }
  33. cout << ++count << " : " << start << endl;
  34. }
  35. cout << "sheet" << count + s.size() << endl;
  36. cout << "solved :" << s.size()<<endl;
  37. cout << "remaining :" << count << endl;
  38.  
  39. return 0;
  40. }
  41.  
Success #stdin #stdout 0s 5320KB
stdin
A
T
S
O
T
R
Q
P
N
M
L
K
J
I
G
H
0
stdout
from :
to :
enter characters:
1 : A
2 : B
3 : C
4 : D
5 : E
6 : F
sheet20
solved :14
remaining :6