hopingsteam

Subiectul 3 -> Problema 3

Apr 7th, 2021
394
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include    <iostream>
  2. #include    <fstream>
  3.  
  4. using namespace std;
  5.  
  6. ifstream fin("bac.in");
  7.  
  8. unsigned int V_ap[100];
  9.  
  10. int main()
  11. {
  12.     unsigned int nr, k = 0;
  13.     while(fin >> nr)
  14.     {
  15.         if(nr >= 10 && nr <= 99)
  16.             V_ap[nr]++;
  17.     }
  18.  
  19.     for(int i = 99; i >= 10; i--)
  20.     {
  21.         if(V_ap[i] == 0 && ((i % 10) != (i / 10 % 10)))
  22.         {
  23.             cout << i << " ";
  24.             k++;
  25.         }
  26.         if(k == 2)
  27.             break;
  28.     }
  29.     return 0;
  30. }
  31.  
RAW Paste Data