您的位置:首页 > 职场人生

经典.net面试题目(3)

2014-06-10 13:33 260 查看
1. asp.net中web应用程序获取数据的流程:

A.Web Page B.Fill C.Sql05 D.Data Sourse E.DataGrid F.DataSet G.Select and Connect

Commands H.Sql Data Adapter

答案:a,e,d,f,h,g,b,c

2. Asp.net执行模式中各组件填入到对应位置:

A.Output Cache B.Parser C.Assembly Cache D.IE E.Memory F.Compiler

WebPage被第一次请求时:

D->__->__->__->__->D

WebPage被第二次请求时:

D->__->__->D

WebPage的页面输出缓存被打开时:

D->__->D

答案:

WebPage被第一次请求时:

D->_b_->_f_->_a_->_e_->D

WebPage被第二次请求时:

D->_b_->_e_->D

WebPage的页面输出缓存被打开时:

D->_a_->D

3.两个数组
[m] n>m
第一个数组的数字无序排列 第二个数组为空 取出第一个数组的最小值 放到第二个数组中第一个位置, 依次类推. 不能改变A数组,不能对之进行排序,也不可以倒到别的数组中。

int[] a = { -20, 9, 7, 37, 38, 69, 89, -1, 59, 29, 0, -25, 39, 900, 22, 13, 55 };

int[] b = new int[10];

int intTmp = a[0], intMaxNum;

for (int i = 0; i < a.Length; i++)

{

intTmp = a[i] > intTmp ? a[i] : intTmp;

}

intMaxNum = intTmp;

for (int j = 0; j < b.Length; j++)

{

for (int i = 0; i < a.Length; i++)

{

if (j == 0)

intTmp = a[i] < intTmp ? a[i] : intTmp;

else

{

if (a[i] > b[j - 1])

intTmp = a[i] < intTmp ? a[i] : intTmp;

}

}

b[j] = intTmp;

intTmp = intMaxNum;

}

foreach (int bb in b)

{

Console.WriteLine(bb);

}

Console.ReadLine();

4.请将字符串"I am a student"按单词逆序输出 如"student a am I"

string S = "I am a student";

char[] C = new char[] { ' '};

string[] n =S.Split(C);

int length = S.Length;

for (int i =length-1 ; i >=0; i--)

{

Console.Write(n[i]);

if (i != 0)

{

Console.Write(" ");

}

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: