Created
April 15, 2016 07:40
-
-
Save jwvg0425/7b8e24ca778019bbc478715aa6bed14d to your computer and use it in GitHub Desktop.
4dir
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <iostream> | |
| using namespace std; | |
| int main() | |
| { | |
| for(int i =0; i < 4; i++) | |
| { | |
| int x = (i - 1) * (i % 2 - 1); | |
| int y = (i - 2) * (i % 2); | |
| cout << "(" << x << "," << y << ")" << endl; | |
| } | |
| return 0; | |
| } | |
| /* output | |
| (1,0) | |
| (0,-1) | |
| (-1,0) | |
| (0,1) | |
| */ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment