Mozilla 為Firefox 4.0發行所做的網站...
2011/04/05
2011/04/01
亂數
#include <cstdlib>
#include <iostream>
#include <time.h>
using namespace std;
int main(int argc, char *argv[])
{
bool Find = false;
int A,B;//表示範圍的起始與結束
int Change;
int Num;
int Temp;
int Index = 0;
srand(time(NULL));
cout << "請輸入範圍起始值:";
cin >> A;
cout << "請輸入範圍結束值:";
cin >> B;
if(A>B)
{
Change = A;
A = B;
B = Change;
}
cout << "請輸入亂數個數:";
cin >> Num;
int Box[Num];
for(int i=0; i<Num; i++)
{
Box[i] = 0;
}
Box[Num-1] = -1;
while(Box[Num-1] == -1)
{
Find = false;//此處旗標需重新設定為false!
Temp = rand()%B+A;
for(int j=0; j<Num; j++)
{
if(Box[j] == Temp)
{
Find = true;
break;
}
}
//
if(!Find)
{
Box[Index] = Temp;
Index++;
}
}
//輸出產生的亂數
cout << "產生的亂數:" << endl;
for(int k=0; k<Num; k++)
{
cout << Box[k] << " ";
}
cout << endl;
system("PAUSE");
return EXIT_SUCCESS;
}
2011/03/29
2011/02/08
2011/02/05
Code Convert
將程式碼轉成HTML語法貼到Blogger
centricle.com/tools/html-entities/
又找到一個
http://formatmysourcecode.blogspot.com/
centricle.com/tools/html-entities/
又找到一個
http://formatmysourcecode.blogspot.com/
2011/02/03
民國轉西元紀年
#include <stdlib.h> #include <string> #include <iostream> #include <fstream> #include <sstream> using namespace std; int main() { string InName = ""; string OutName = ""; string LineData = ""; string TempData = ""; stringstream Final; int Data; string List[10000][3]; int Row = 0; int Col = 0; for(int i=0; i<100; i++) { for(int j=0; j<3; j++) { List[i][j] = "-1"; } } cout << "Please Input Source File:"; getline(cin,InName); cout << "Please Input Output File:"; getline(cin,OutName); ifstream infile(InName.c_str(),ios::in); ofstream outfile(OutName.c_str(),ios::app); if(infile) { while(!infile.eof()) { getline(infile,LineData); LineData = LineData + "/"; for(int i=0; i<LineData.length(); i++) { if(LineData[i] != '/') { TempData = TempData + LineData[i]; } else { List[Row][Col] = TempData; Col++; TempData = ""; } } Col = 0; Row++; LineData = ""; } } //讀取失敗時提示錯誤 else { cout << "WRONG" << endl; } //進行轉換 for(int i=0; i<Row; i++) { if(List[i][0] != "-1") { Data = atoi(List[i][0].c_str())+1911; Final << Data; List[i][0] = Final.str(); Final.str(""); } else { break; } } //輸出檔案 for(int i=0; i<Row; i++) { for(int j=0; j<3; j++) { outfile << List[i][j]; if(j<2) { outfile << "/"; } } outfile << endl; } cout << "DONE." << endl; return 0; }
2010/12/28
[轉載]一步步教你使用再生龍Clonezilla輕鬆製作還原檔及還原光碟
再生龍Clonezilla是一套由國家高速網路與計算中心所製作的自由軟體,因此可以任意散布複製且不需要購買版權即可使用。
先來下載再生龍吧~~再生龍Clonezilla穩定發行版 103MB下載完畢後用燒錄軟體燒出來吧。
先來下載再生龍吧~~再生龍Clonezilla穩定發行版 103MB下載完畢後用燒錄軟體燒出來吧。
2010/12/24
訂閱:
文章 (Atom)