Advertisement
Norbysweg

6

Nov 11th, 2021
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. #include <iostream>
  2. #include <fstream>
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. int s,x=-1;
  8. cin>>s;
  9. while(s>0)
  10. {
  11. s=s-3;
  12. x++;
  13. }
  14. ofstream fout("rez.dat");
  15. fout<<x<<" ";
  16. if(s+3==1)
  17. fout<<x<<" "<<x+1;
  18. else
  19. fout<<x+1<<" "<<x+1;
  20. fout.close();
  21. return 0;
  22. }
  23.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement