Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <fstream>
- using namespace std;
- int main()
- {
- int n,p;
- ifstream f("balmascat.in");
- f>>n>>p;
- f.close();
- int ncfi=n/p;
- if(n%p!=0)
- ++ncfi;
- int cifra=ncfi%10,cifpozimp;
- if(cifra==9)
- cifpozimp=cifra-1;
- else
- cifpozimp=cifra+1;
- ofstream g("balmascat.out");
- for(int i=1;i<=2*p-1;++i)
- if(i%2)
- g<<cifpozimp;
- else
- g<<cifra;
- g.close();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement