#include <stdio.h>
#include <stdlib.h>
int c; /*case*/
int i,j,tmp;
int main(){
scanf("%d",&c); /*輸入case數*/
int S[2][c]; /*宣告 case * 2 的矩陣,擺放每個case的Amplitude及Frequency值*/
for(i=0;i<c;i++){
scanf("%d%d", &S[0][i], &S[1][i]);
while(S[1][i]>0){
for(j=1 ; j<=S[0][i] ; j++){
for(tmp=0; tmp<j; tmp++)
printf("%d",j);
printf("\n");
}
for(j=S[0][i]-1 ; j>0 ; j--){
for(tmp=0; tmp<j; tmp++)
printf("%d",j);
printf("\n");
}
S[1][i]--;
if(S[1][i]>0)printf("\n");
}
if(i<(c-1))printf("\n");
}
return 0;
}
2014年8月12日星期二
[UVa] 488 - Triangle Wave
2014年8月10日星期日
Setup MinGW (GCC Compiler in Windows)
Download and Install
MinGW Homepage: http://www.mingw.org/
Download MinGW installer: http://sourceforge.net/projects/mingw/files/Installer/
In MinGW Installation Manager window, we can only choose mingw32-gcc-g++ (The GNU C++ Compiler) then Apply Change to setup.
Environment Settings
- Right-click on your "My Computer" icon and select "Properties".
- Click on the "Advanced" tab, then on the "Environment Variables" button.
- You should be presented with a dialog box with two text boxes. The top box shows your user settings. The PATH entry in this box is the one you want to modify. Note that the bottom text box allows you to change the system PATH variable. You should not alter the system path variable in any manner, or you will cause all sorts of problems for you and your computer!
- Click on the PATH entry in the TOP box, then click on the "Edit" button
- Scroll to the end of the string and at the end add
;<installation-directory>\bin
- press OK -> OK -> OK and you are done.
2014年8月9日星期六
[POJ] 3617 - Best Cow Line
#include <stdio.h>
#include <stdlib.h>
int N, cnt = 0, i;
char S[2001];
void solve(){
int a = 0, b = N-1;
while(a <= b){
int left = 0;
for (i = 0; a+1<=b; i++){
if(S[a+i] < S[b-i]){
left = 1;
break;
}
else if(S[a+i] > S[b-i]){
left = 0;
break;
}
}
if(left)putchar(S[a++]);
else putchar(S[b--]);
cnt++;
if(cnt %80 == 0)putchar('\n');
}
putchar('\n');
}
int main(){
while(scanf("%d",&N)!= EOF){
for(i=0; i<N; i++)
{
getchar(); //避免前面的scanf遺留的換行(\n)讀入
scanf("%c", &S[i]);
}
solve();
}
return 0;
}
2014年8月7日星期四
新的開始
學生時期接觸的多半是電機方面的知識,多半是自動控制居多,所撰寫的程式也僅包含了影像傳輸、人機介面和機械控制的部分。
在網路上找到幾個網站,再配上幾本書籍,希望在鑽研許久之後,可以提升自己的程式能力,起碼不要和資訊專業的人相差太多,對未來工作相信也會有所幫助。
§參考資料
§Online Judge
若有增加,再來補齊。
在網路上找到幾個網站,再配上幾本書籍,希望在鑽研許久之後,可以提升自己的程式能力,起碼不要和資訊專業的人相差太多,對未來工作相信也會有所幫助。
§參考資料
- 演算法筆記:http://www.csie.ntnu.edu.tw/~u91029/index.html
- C++程式設計:http://www.tcgs.tc.edu.tw/~sagit/cpp/
- Cplusplus :http://www.cplusplus.com/
- 建中資訊科培訓網:http://pisces.ck.tp.edu.tw/~peng/index.php?year=2009
- C語言學習筆記:http://openhome.cc/Gossip/CGossip/
- Beej's Guide to Unix Network Programming: http://beej-zhtw.netdpi.net/
§Online Judge
- PKU Judge:poj.org
- UVa Online Judge:http://uva.onlinejudge.org/
若有增加,再來補齊。
2014年8月1日星期五
How to set up the TrackPoint in Linux in Thinkpad X40
Configuration using xinput
If you want to modify changes on the fly, you can do so with
xinput (part of the optional xorg-x11-apps rpm on Fedora).
Note that these changes are not saved when the xserver is restarted. However, you can add the lines e.g. in your .xsessionrc (depends on your distribution) so they are executed every time X starts.
To query the available options
xinput list-props "TPPS/2 IBM TrackPoint"
More information can be found in the man-pages for evdev
man evdev
To enable vertical scrolling
xinput set-prop "TPPS/2 IBM TrackPoint" "Evdev Wheel Emulation" 1 xinput set-prop "TPPS/2 IBM TrackPoint" "Evdev Wheel Emulation Button" 2 xinput set-prop "TPPS/2 IBM TrackPoint" "Evdev Wheel Emulation Timeout" 200
To enable horizontal scrolling in addition to vertical scrolling
xinput set-prop "TPPS/2 IBM TrackPoint" "Evdev Wheel Emulation Axes" 6 7 4 5
To enable middle button emulation (using left- and right-click simultaneously)
xinput set-prop "TPPS/2 IBM TrackPoint" "Evdev Middle Button Emulation" 1 xinput set-prop "TPPS/2 IBM TrackPoint" "Evdev Middle Button Timeout" 50
文章參考來源:http://www.thinkwiki.org/wiki/How_to_configure_the_TrackPoin
訂閱:
文章 (Atom)
-
文章出處: http://infbugs.blogspot.tw/2011/12/c_20.html 謝謝沙耶,解答了我長久以來對於 input/output 的疑惑。 C 語言入門 - 在線上批改系統練功 如何練習使用基本語法 自己出個練習題試著寫...
-
因為X205的架構非常獨特,Linux對其硬體的支援度非常弱(據說kernel4.0之後有所改善,這倒還需要研究一番),目前的進度是將Ubuntu系統塞進32Gb的固態碟中,並設定能自動抓取開機磁區,之後可能還要針對WIFI、音效、快捷鍵和讀卡機等週邊設備進行設定。 1...
-
一開始用數學方法推斷得出,設輸入為n k為在n的前一斜線列數,故只要找到 (1+k)*k/2 < n 的最大k值,即可判定 k%2 == 1 => ((2*n)-(k*k)-k)/2 / ((k*k)+(3*k)-(2*n)+4)/2 k%2 ==...