Advertisement
aimon1337

Untitled

Apr 15th, 2021
670
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.55 KB | None | 0 0
  1. #include <iostream>
  2. #include <fstream>
  3. using namespace std;
  4. ofstream fout("iesire.txt");
  5. int main(){
  6.     int i,j,k;
  7.     int s1, s2;
  8.     cin>>s1>>s2;
  9.     for(i=1;i<=9 && i<=s1; ++i){
  10.         for(j=0;j<=9;++j){
  11.             for(k=0;k<=9 && k<=s2; ++k){
  12.                 if((s1-i>=0) && (s1-i<=9)){
  13.                     if((s2-k>=0) && (s2-k<=9)){
  14.                         fout<<i<<(s1-i)<<j<<k<<(s2-k);
  15.                         fout<<endl;
  16.                     }
  17.                 }
  18.             }
  19.         }
  20.     }
  21.     fout.close();
  22.     return 0;
  23. }
  24. //1661
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement