{"action":"opened","issue":{"url":"https://api.github.com/repos/locust6/Code/issues/51","repository_url":"https://api.github.com/repos/locust6/Code","labels_url":"https://api.github.com/repos/locust6/Code/issues/51/labels{/name}","comments_url":"https://api.github.com/repos/locust6/Code/issues/51/comments","events_url":"https://api.github.com/repos/locust6/Code/issues/51/events","html_url":"https://github.com/locust6/Code/issues/51","id":177575899,"number":51,"title":"Tower of Hanoi","user":{"login":"locust6","id":17775562,"avatar_url":"https://avatars.githubusercontent.com/u/17775562?v=3","gravatar_id":"","url":"https://api.github.com/users/locust6","html_url":"https://github.com/locust6","followers_url":"https://api.github.com/users/locust6/followers","following_url":"https://api.github.com/users/locust6/following{/other_user}","gists_url":"https://api.github.com/users/locust6/gists{/gist_id}","starred_url":"https://api.github.com/users/locust6/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/locust6/subscriptions","organizations_url":"https://api.github.com/users/locust6/orgs","repos_url":"https://api.github.com/users/locust6/repos","events_url":"https://api.github.com/users/locust6/events{/privacy}","received_events_url":"https://api.github.com/users/locust6/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-09-17T13:29:05Z","updated_at":"2016-09-17T13:29:05Z","closed_at":null,"body":"```\r\n#include <stdio.h>\r\n#include <iostream>\r\nusing namespace std;\r\nvoid wtw(char[],char[]);\r\nvoid RootOfMove(char[],char[],char[]);\r\nvoid TowerOfHanoi(int);\r\nchar string1[6] = \"left\";\r\nchar string2[6] = \"mid\";\r\nchar string3[6] = \"right\";\r\nint i = 1;\r\n\r\nvoid main() {\r\n\tint n;\r\n\tcout << \"please input the number of TowerOfHanoi:\";\r\n\tcin >> n;\r\n\tcout << endl << \"the best step is:\" << endl << endl;\r\n\tTowerOfHanoi(n);\r\n}\r\n\r\nvoid exchangeSTR(char string1[],char string2[]) {\r\n\tchar x[6];\r\n\tstrcpy(x,string1);\r\n\tstrcpy(string1,string2);\r\n\tstrcpy(string2,x);\r\n}\r\n\r\nvoid wtw(char string1[],char string2[]) {\r\n\tcout << i++ << '.' << ' ' << string1 << \" -> \" << string2 << endl << endl;\r\n}\r\n\r\nvoid RootOfMove(char string1[],char string2[],char string3[]) {\r\n\twtw(string1,string2);\r\n\twtw(string1,string3);\r\n\twtw(string2,string3);\r\n}\r\n\r\nvoid TowerOfHanoi(int n) {\r\n\tif (n == 1) {\r\n\t\twtw(string1,string3);\r\n\t}else if (n == 2) {\r\n\t\tRootOfMove(string1,string2,string3);\r\n\t}else {\r\n\t\texchangeSTR(string2,string3);\r\n\t\tTowerOfHanoi(n-1);\r\n\t\texchangeSTR(string2,string3);\r\n\t\twtw(string1,string3);\r\n\t\texchangeSTR(string1,string2);\r\n\t\tTowerOfHanoi(n-1);\r\n\t\texchangeSTR(string1,string2);\r\n\t}\r\n}\r\n```"}}
{"actor":{"display_login":"locust6"}}