C/C++ 笔试、面试题目大汇总
return 0;
}
int fn3()
{
printf( "is " );
return 0;
}
int fn4()
{
printf( "This " );
return 0;
}
The _onexit function is passed the address of a function (func) to be called when the program terminates normally. Successive calls to _onexit create a register of functions that are executed in LIFO (last-in-first-out) order. The functions passed to _onexit cannot take parameters.
38. 如何判断一段程序是由C 编译程序还是由C++编译程序编译的?
答案:
#ifdef __cplusplus
cout<<"c++";
#else
cout<<"c";
#endif
39.文件中有一组整数,要求排序后输出到另一个文件中
答案:
#i nclude<iostream>
#i nclude<fstream>
using namespace std;
void Order(vector<int>& data) //bubble sort
{
int count = data.size() ;
int tag = false ; // 设置是否需要继续冒泡的标志位
for ( int i = 0 ; i < count ; i++)
{
for ( int j = 0 ; j < count - i - 1 ; j++)
{
if ( data[j] > data[j+1])
{
tag = true ;
int temp = data[j] ;
data[j] = data[j+1] ;
data[j+1] = temp ;
}
}
if ( !tag )
break ;
}
}
void main( void )
{
vector<int>data;
ifstream in("c:\\data.txt");
if ( !in)
{
cout<<"file error!";
exit(1);
}
int temp;
while (!in.eof())
{
in>>temp;
data.push_back(temp);
}
in.close(); //关闭输入文件流
Order(data);
上一页 [1] [2] [3] [4] [5] [6] [7] 下一页
- 上一篇:banma做的电子商务笔试题目
《C/C++ 笔试、面试题目大汇总》相关文章
- C/C++ 笔试、面试题目大汇总
- › 应聘职位名称 —— Accounting and Finance(会计与财务部分)
- › ACCOUNTANT(General)
- › An accounting position about financial
- › Resume accounts 会计行业英文简历应届生
- › 英文简历2--accounting-cl.doc
- › 英文简历(会计师)ACCOUNTANT(General)
- › 会计师英文简历ACCOUNTANT(General)
- › 专家写的英文简历模板ACCOUNTANT(General)
- › 会计人员英文简历Accounting Manager
- › 会计Accountant笔试题
- › cicc MRM 笔经
- › 埃森哲accenture笔试题型
- 在百度中搜索相关文章:C/C++ 笔试、面试题目大汇总
- 在谷歌中搜索相关文章:C/C++ 笔试、面试题目大汇总
- 在soso中搜索相关文章:C/C++ 笔试、面试题目大汇总
- 在搜狗中搜索相关文章:C/C++ 笔试、面试题目大汇总