Advertisement
a53

balmascat

a53
Jan 31st, 2018
202
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. #include <fstream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. int n,p;
  8. ifstream f("balmascat.in");
  9. f>>n>>p;
  10. f.close();
  11. int ncfi=n/p;
  12. if(n%p!=0)
  13. ++ncfi;
  14. int cifra=ncfi%10,cifpozimp;
  15. if(cifra==9)
  16. cifpozimp=cifra-1;
  17. else
  18. cifpozimp=cifra+1;
  19. ofstream g("balmascat.out");
  20. for(int i=1;i<=2*p-1;++i)
  21. if(i%2)
  22. g<<cifpozimp;
  23. else
  24. g<<cifra;
  25. g.close();
  26. return 0;
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement