Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "pch.h"
- #include <iostream>
- #include <string>
- #include <sstream>
- using namespace std;
- int main()
- {
- int doubleCounter = 0;
- for (int i = 100; i < 1000; i++)
- {
- string t = "";
- stringstream someStream;
- someStream << i;
- t = someStream.str();
- if (t[0] == t[1] || (t[0] == t[2]) || (t[1] == t[2]));
- {
- doubleCounter++;
- cout << "Got number with double digits:\t " << i << endl;
- }
- }
- cout << "Summary: " << doubleCounter << endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement