把文件掃描成PDF的工具
官網: http://www.softwareok.com/?seite=Microsoft/WinScan2PDF
2011/11/20
2011/11/19
2011/11/12
[ArchLinux]開機時啟動Num Lock
X.org
If you use startx to start your X session, simply install the numlockx package and add it to your ~/.xinitrc file.
Install numlockx:
# pacman -S numlockx
Add it to ~/.xinitrc before exec:
#!/bin/sh # # ~/.xinitrc # # Executed by startx (run your window manager from here) # numlockx & exec your_window_manager
2011/11/11
2011/11/02
[C++]讀檔寫到陣列
一支用來讀取文字檔內容並且將資料轉成數值供運算的程式
其中每一行的資料數n可以自訂
可以儲存的資料這邊預設最多到100行
#include <cstdlib>
#include <iostream>
#include <fstream>
using namespace std;
int main(int argc, char *argv[])
{
int n;
string Loc;
string Line;
string Get = "";
int Row = 0;
int Col = 0;
int End = 0;
cout << "請輸入檔案路徑:";
getline(cin,Loc);
cout << "每行有幾筆資料:";
cin >> n;
int Box[100][n];
for(int i=0; i<100; i++)
{
for(int j=0; j<n; j++)
{
Box[i][j] = -1;
}
}
ifstream infile(Loc.c_str(),ios::in);
if(infile)
{
while(!infile.eof())
{
getline(infile,Line);
Line = Line + " ";
for(int i=0; i<Line.length(); i++)
{
if(Line[i] != ' ')
{
Get = Get + Line[i];
}
else
{
Box[Row][Col] = atoi(Get.c_str());
Get = "";
Col++;
}
}
Row++;
End++;
Col = 0;
}
Line = "";
}
//
else
{
cout << "Failed..." << endl;
}
for(int i=0; i<End; i++)
{
for(int j=0; j<n; j++)
{
cout << Box[i][j] << " ";
}
cout << endl;
}
system("PAUSE");
return EXIT_SUCCESS;
}
訂閱:
文章 (Atom)