Advertisement
Guest User

Untitled

a guest
Jan 23rd, 2020
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. #include <fstream>
  4.  
  5. using namespace std;
  6.  
  7. int vc[10];
  8.  
  9. int main()
  10.  
  11. {
  12.  
  13.    ifstream f("ciffrecv.in");
  14.  
  15.    ofstream g("ciffrecv.out");
  16.  
  17.    int cif;
  18.  
  19.    while (!f.eof())
  20.  
  21.    {
  22.  
  23.        f >> cif; ++vc[cif];
  24.  
  25.    }
  26.  
  27.    cif=7;
  28.  
  29.    if (vc[cif]) g << cif << " " << vc[cif];
  30.  
  31.    else  if (vc[cif-2]) { cif-=2; g << cif << " " << vc[cif]; }
  32.  
  33.          else if (vc[cif-4]) { cif-=4; g << cif << " " << vc[cif]; }
  34.  
  35.               else if (vc[cif-5]) { cif-=5; g << cif << " " << vc[cif]; }
  36.  
  37. }
  38.  
  39. Citește mai multe pe Brainly.ro - https://brainly.ro/tema/5645295#readmore
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement