發表文章

目前顯示的是 11月, 2010的文章

靜態局部變數

It's some kind of local variable. but it's value will not disappear when function end. It store in memory when program start execute. ex. static int asd = 100;

宣告函數預設"預設值"

ex int asa(int a,int b = 5); //ok int asa(int a =2,int b = 5); //ok but int asa(int a =2,int b); //NO

在blogger上面加入code

這個版本比較素拉 因為我覺得其他太花俏了 反而不習慣 在修改html選項中 加入以下code .post pre { background: #F0F0F0 url(http://你的圖片網址/blogger-code.gif) repeat-y scroll left top; border: 1px solid #CCCCCC; color: #333333; display: block; font-family: Courier New; font-size: 9pt; line-height: 100%; margin: 5px 0 0 20px; max-height: 500px; overflow: auto; padding: 10px 10px 10px 21px; width: 90%; } 之後在發布文章時只要把code用 包起來 例如 ..... 這樣就可以了~

a005: Eva 的回家作業

#include using namespace std; int main(){ int count; while(cin>>count){ int array[count][3]; for(int i=0;i for(int j=0;j cin>> array[i][j]; } if((array[i][1]-array[i][0]) == (array[i][2]-array[i][1])){ cout } else{ cout } }//for }//while return 0; }//main 關於二維陣列寫入遇到一個大問題= = 雖然還沒解決此題就AC了 改天解決了在把問題PO上來...

a004: 文文的求婚

#include using namespace std; int main(){ int a; while(cin>>a){ if(((a%4 ==0) && !(a%100 == 0)) || (a%400 == 0)){ cout } else{ cout } } return 0; }

a003: 兩光法師占卜術

#include using namespace std; int main(){ int m,d,s; while(cin>>m>>d){ s=(m*2+d)%3; switch (s){ case 0: cout break; case 1: cout break; case 2: cout break; default: break; } } return 0; }

a002: 簡易加法

#include using namespace std; int main(){ int a,b; while(cin>>a>>b){ cout } return 0; }

a001: 哈囉

#include using namespace std; int main() { string s; while(cin >> s){ cout } return 0; }

雖然這幾個星期很忙

不過還是開始吧 練C++ 高中老師有說 不用急著做完 這至少代表已經開始