[关闭]
@songlaf 2018-05-17T03:00:15.000000Z 字数 805 阅读 494

注:代码可以用C#或者Java来实现

一)写一个程序计算1+2+3+..n

二)写一个冒泡法排序的程序

三)实现一个双向链表

四)实现生产者消费者队列

五)解释下策略模式,并用代码实现。

六)某网站的用户信息表如下,

1)找出用户数超过50的城市
2)找出年龄在20,到60之间的用户的姓名。

id(编号) name(姓名) city(城市) age(年龄)
1 张三 南京 90
2 李四 上海 100
3 王五 北京 90
... ... ... ...

七)下面的JavaScript代码输出结果是什么?变量flag有什么问题?

  1. function Company(id,name) {
  2. flag = 100;
  3. this.name = name;
  4. this.Department = [
  5. {ID:1,Name:"软件部"},
  6. {ID:1,Name:"市场部"},
  7. ];
  8. this.showDepartment = function () {
  9. $.each(this.Department,function (i,v) {
  10. console.log("公司名称"+this.name);
  11. console.log(v);
  12. console.log(v.Name);
  13. });
  14. };
  15. };
  16. var company = new Company(100,"智远弘业");
  17. company.showDepartment();

八)用JavaScript实现下面的C#代码

  1. public class Person
  2. {
  3. public int id { get; set; }
  4. public virtual string getMessage() {
  5. return this.id.ToString();
  6. }
  7. }
  8. public class Employee:Person
  9. {
  10. public string UserName { get; set; }
  11. public virtual string getMessage()
  12. {
  13. return String.Format("{0},{1}", this.id,this.UserName);
  14. }
  15. }
添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注