Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * File: main.cpp
- * Author: antimax
- *
- * Created on 7 Ноябрь 2010 г., 22:01
- */
- #include <stdio.h>
- #include <math.h>
- using namespace std;
- /*
- *
- */
- int kv( int x, int y)
- {
- int i;
- //i= pow(x,2)*1000;
- i= (pow(x,2) - pow(y,2));
- return i;
- }
- int main(int argc, char** argv) {
- long long x=2070;
- long long y=1980;
- int q[4];
- q[0]=150;
- q[1]=152;
- q[2]=155;
- q[3]=160;
- for(int i=3;i>-1;i--)
- { long long w=q[i]*q[i];
- bool f= true;
- while(f)
- {
- long long a=kv(x,y);
- if((a-w)>-2 && (a-w)<2) f=false;
- else if (a>q[i])
- {
- x-=1;
- y+=1;
- //printf("%i %i\n",x,y);
- }
- else
- {
- x+=1;
- y-=1;
- //printf("%i %i\n",x,y);
- }
- }
- printf("%i %i\n",x,y);
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement