codingame吧 关注:149贴子:126
  • 3回复贴,共1

有没有高手能教学怎么玩 power of thor

只看楼主收藏回复

#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
/**
* Auto-generated code below aims at helping you parse
* the standard input according to the problem statement.
* ---
* Hint: You can use the debug stream to print initialTX and initialTY, if Thor seems not follow your orders.
**/
int main()
{
int lightX; // the X position of the light of power
int lightY; // the Y position of the light of power
int initialTX; // Thor's starting X position
int initialTY; // Thor's starting Y position
cin >> lightX >> lightY >> initialTX >> initialTY; cin.ignore();
// game loop
while (1) {
int remainingTurns; // The remaining amount of turns Thor can move. Do not remove this line.
cin >> remainingTurns; cin.ignore();
// Write an action using cout. DON'T FORGET THE "<< endl"
// To debug: cerr << "Debug messages..." << endl;
cout << "SE" << endl; // A single line providing the move to be made: N NE E SE S SW W or NW
}
}
代码在这,实际是要我们写些什么操作才能运行控制thor移动


1楼2015-10-18 23:27回复
    你就判断一下坐标,然后看看要如何移动(每次只能移动一步),才能使雷神坐标和闪电坐标一致


    2楼2015-11-05 23:22
    收起回复