Advertisement
punidota

Untitled

Sep 19th, 2015
393
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.38 KB | None | 0 0
  1. #include "stdafx.h"
  2. #include <stdio.h>
  3. #include "math.h"
  4. #include <iostream>
  5.  
  6. using namespace std;
  7. int main()
  8. {
  9.     int n, n1, n2, n3, count = 0;
  10.     for (n = 111; n <= 999; n++)
  11.     {
  12.         n1 = n;
  13.         n3 = n1 % 10;
  14.         n1 /= 10;
  15.         n2 = n1 % 10;
  16.         n1 /= 10;
  17.  
  18.         if ((n1 == n2) || (n2 == n3) || (n1 == n3))
  19.         count++;       
  20.     }
  21.     cout << count << "chisel" << endl;
  22.     system("pause");
  23.     return 0;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement