Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include<fstream>
- using namespace std;
- int main(){
- ifstream f1("atestat.in");
- ofstream f2("atestat.out");
- int n,k,y,z=0,OK=0,q;
- f1>>n>>k;
- y=n;
- while(y!=0){
- if(y%10!=k)
- z=z*10+y%10;
- y=y/10;
- }
- while(z!=0){
- y=y*10+z%10;
- z=z/10;
- }
- z=1;
- f2<<y<<endl;
- while(OK==0){
- z = z * k;
- if(z > n)
- OK=1;
- }
- f2<<z/2;
- f2.close();
- f1.close();}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement