{"id":86,"date":"2011-08-01T13:26:21","date_gmt":"2011-08-01T05:26:21","guid":{"rendered":"http:\/\/wangkaixuan.tech\/?p=86"},"modified":"2020-06-03T13:26:57","modified_gmt":"2020-06-03T05:26:57","slug":"uvaoj-488-triangle-wave","status":"publish","type":"post","link":"http:\/\/www.wangkaixuan.tech\/?p=86","title":{"rendered":"uvaoj 488 &#8211; Triangle Wave"},"content":{"rendered":"\n<pre class=\"wp-block-code\"><code>#define LOCAL\n#include&lt;iostream>\nusing namespace std;\nvoid print(int n)\n{\n       int i,j;\n       for(i=1;i&lt;n;i++)\n       {\n            for(j=0;j&lt;i;j++)\n                 cout&lt;&lt;i;\n            cout&lt;&lt;endl;               \n       }\n       for(i=n;i>=1;i--)\n       {\n            for(j=0;j&lt;i;j++)\n                 cout&lt;&lt;i;\n            cout&lt;&lt;endl;               \n       }     \n}\nint main()\n{\n#ifdef LOCAL\n       freopen(\"input.txt\",\"r\",stdin);\n       freopen(\"output.txt\",\"w\",stdout);\n#endif\n    \n    \n    int n,x,y,first=1;\n    cin>>n;\n    while(n--)\n    {\n          if(!first)\n          {cout&lt;&lt;endl;}\n          else\n             first=0; \n         cin.get();           \/\/\u6211\u4ee5\u4e3ax,y\u90fd\u662f\u6574\u578bcin\u5c31\u4f1a\u8df3\u8fc7\u7a7a\u683c\uff0c\u770b\u6765\u6211\u9519\u4e86\u3002\u3002\u3002 \n         cin>>x>>y;\n         print(x);\n         y--;\n         while(y--)\n         {\n               cout&lt;&lt;endl;\n               print(x);          \n         }          \n    }\n    return 0;\n}<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[],"class_list":["post-86","post","type-post","status-publish","format-standard","hentry","category-06-01-acm"],"_links":{"self":[{"href":"http:\/\/www.wangkaixuan.tech\/index.php?rest_route=\/wp\/v2\/posts\/86","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.wangkaixuan.tech\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.wangkaixuan.tech\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.wangkaixuan.tech\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/www.wangkaixuan.tech\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=86"}],"version-history":[{"count":0,"href":"http:\/\/www.wangkaixuan.tech\/index.php?rest_route=\/wp\/v2\/posts\/86\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.wangkaixuan.tech\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=86"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.wangkaixuan.tech\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=86"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.wangkaixuan.tech\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=86"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}