This question has already been answered:

uses crt; var i,k:integer; a,b:byte; begin clrscr; k:=0; i:=999; while i<9999 do begin i:=i+1; a:=i div 100 mod 10; b:=i div 10 mod 10; if(i mod 45=0)and(((a=9)and(b=7))or((a=7)and(b=9))) then begin writeln(i); k:=k+1; end; end; write('Всего чисел=',k); readln end. 

Marked as a duplicate by participants Vladimir Martyanov , D-side , ixSci , aleksandr barakin , Nicolas Chabanovsky 23 May '16 at 16:09 .

A similar question was asked earlier and an answer has already been received. If the answers provided are not exhaustive, please ask a new question .

  • 7
    I vote for the closure of this issue as not relevant topic, because there is no translation bureau - Vladimir Martyanov

1 answer 1

https://ideone.com/Md7kXC
https://ideone.com/rwSif8

 #include <iostream> #include <iterator> #include <vector> #include <algorithm> using namespace std; int main() { vector <int> res = { 2790, 2970, 6795, 6975 }; copy(res.begin(), res.end(), ostream_iterator<int>(cout, "\n")); cout << "Всего чисел=" << res.size() << '\n'; return 0; }