C++二级机试问题...高手进

来源:百度知道 编辑:UC知道 时间:2024/06/17 16:44:36
#include <iostream.h>
#include <fstream.h>
#include <stdio.h>
#include <string>

int find(char s[ ], char t[ ]) ;
void wriDat() ;
const int MAXLINE = 256;
int main( )
{
char source[MAXLINE], target[MAXLINE];
cout << "Please input a string for searching:\n";
cin.getline(source, MAXLINE);
cout << "Please input a string you want to find:\n";
cin.getline(target, MAXLINE);
int intPos = find(source, target);
if(intPos >= 0)
cout << "Finding it. The target string is at index " << intPos << " of the source string \n";
else
cout << "Not finding it.\n";
wriDat() ;
return 0;
}
int find(char s[ ], char t[ ])
{

}

/* 读取数据文件并写结果文件, 考生无需修改, 否则后果自负 */
void wriDat()
{
fstream rFile, wFile ;

上面的人别故作高深
没分啊
不做

这个问题不是简单复杂的问题,提问的人如果这个题不会作的话,实在是不应该,建议再复习算法课程,数组和循环是编程中普遍的不能再普遍的了,这个作不出来几乎是寸步难行.