Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "stdafx.h"
- #include <stdio.h>
- #include "math.h"
- #include <iostream>
- using namespace std;
- int main()
- {
- int n, n1, n2, n3, count = 0;
- for (n = 111; n <= 999; n++)
- {
- n1 = n;
- n3 = n1 % 10;
- n1 /= 10;
- n2 = n1 % 10;
- n1 /= 10;
- if ((n1 == n2) || (n2 == n3) || (n1 == n3))
- count++;
- }
- cout << count << "chisel" << endl;
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement