Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // homework_1702020.cpp:
- //
- #include "pch.h"
- #include <iostream>
- #include <string>
- #include <sstream>
- using namespace std;
- int main()
- {
- //vtoraya zada4a
- /*int x, y, z;
- cin >> x >> y;
- z = x;
- for (int i = 1; i < y; i++)
- {
- z *= x;
- }
- cout << z;*/
- 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