?? 13v.cpp
字號:
// Perform a binary search of the names in file "namelist.txt"
#include <iostream>
#include <fstream>
#include <string>
using namespace std;const int NUMNAMES = 10;
int Find (String, String[], int, int);
void main()
{ string name_array[NUMNAMES], name;
ifstream infile ("namelist.txt", ios::in);
int n;
for (n=0; n<NUMNAMES; n++)
infile >> name_array[n]; // read in names
cout << " enter name to be found: ";
cin >> name; // get name for search..
cout << name << " found at index "
<< Find (name, name_array, 0, NUMNAMES-1);
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -