Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <vector>
- #define _USE_MATH_DEFINES
- #include <math.h>
- using namespace std;
- int main()
- {
- vector<pair<int, int>> pts( 5, pair<int, int>( 1, 0 ) );
- int n;
- cin >> n;
- while( n-- > 0 )
- {
- int cmd, pt, arg;
- cin >> cmd >> pt >> arg;
- if( cmd == 1 )
- pts[pt-1].first += arg;
- else
- pts[pt-1].second -= arg;
- double x = 0, y = 0;
- double arg2 = 0;
- for( int i = 0; i < 5; i++ )
- {
- x += pts[i].first * cos( arg2 += pts[i].second * M_PI / 180.0 );
- y += pts[i].first * sin( arg2 );
- }
- cout << "(" << x << ", " << y << ")" << endl;
- }
- system( "PAUSE" );
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement