• 大小: 347KB
    文件类型: .zip
    金币: 2
    下载: 1 次
    发布日期: 2021-01-03
  • 语言: C/C++
  • 标签: C++  习题答案  

资源简介

Introduction to Programming with C++(Pearson) 课后习题答案

资源截图

代码片段和文件信息

#include 
#include 
using namespace std;

int parseBinary(const string &binaryString)
{
  int value = binaryString[0] - ‘0‘;
  for (int i = 1; i < binaryString.length(); i++)
  {
    value = value * 2 + binaryString[i] - ‘0‘;
  }

  return value;
}


int main()
{
  cout << “Enter a bianry number: “;
  string bianryString;
  cin >> bianryString;
  cout << parseBinary(bianryString) << endl;

  return 0;
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     文件         450  2009-01-06 20:43  evennumberedexercise\Exercise10_10.cpp
     文件         954  2009-01-06 21:20  evennumberedexercise\Exercise10_12.cpp
     文件         662  2006-08-25 18:22  evennumberedexercise\Exercise10_14.cpp
     文件        1090  2007-11-06 11:34  evennumberedexercise\Exercise10_16.cpp
     文件        1174  2006-03-14 13:00  evennumberedexercise\Exercise10_18.cpp
     文件        4021  2006-06-13 16:33  evennumberedexercise\Exercise10_2.cpp
     文件        1398  2009-01-29 14:29  evennumberedexercise\Exercise10_20.cpp
     文件         654  2006-03-14 13:59  evennumberedexercise\Exercise10_22.cpp
     文件         791  2008-12-09 19:19  evennumberedexercise\Exercise10_4.cpp
     文件        1062  2006-03-12 13:18  evennumberedexercise\Exercise10_6.cpp
     文件         314  2006-03-12 13:36  evennumberedexercise\Exercise10_8.cpp
     文件         510  2008-10-14 20:42  evennumberedexercise\Exercise11_10.cpp
     文件         735  2009-02-03 22:04  evennumberedexercise\Exercise11_2.cpp
     文件         585  2009-02-03 22:08  evennumberedexercise\Exercise11_4.cpp
     文件         498  2006-03-12 13:33  evennumberedexercise\Exercise11_6.cpp
     文件        1933  2008-04-13 16:20  evennumberedexercise\Exercise11_8.cpp
     文件        1305  2008-04-14 08:40  evennumberedexercise\Exercise12_10.cpp
     文件        1913  2008-05-19 10:20  evennumberedexercise\Exercise12_12.cpp
     文件         525  2008-08-28 13:55  evennumberedexercise\Exercise12_2.cpp
     文件         691  2006-03-14 22:13  evennumberedexercise\Exercise12_4.cpp
     文件         928  2006-03-15 09:37  evennumberedexercise\Exercise12_6.cpp
     文件        1453  2006-03-15 10:31  evennumberedexercise\Exercise12_8.cpp
     文件        1353  2008-10-24 15:27  evennumberedexercise\Exercise13_10.cpp
     文件        1058  2008-06-03 19:24  evennumberedexercise\Exercise13_12.cpp
     文件         551  2008-05-19 12:51  evennumberedexercise\Exercise13_2.cpp
     文件        1268  2006-03-14 10:54  evennumberedexercise\Exercise13_4.cpp
     文件         820  2008-05-21 10:26  evennumberedexercise\Exercise13_6.cpp
     文件         914  2008-06-02 08:31  evennumberedexercise\Exercise13_8.cpp
     文件        3712  2006-03-14 14:43  evennumberedexercise\Exercise14_2.cpp
     文件         800  2006-03-14 14:54  evennumberedexercise\Exercise14_4.cpp
     文件         980  2006-03-14 16:36  evennumberedexercise\Exercise15_2.cpp
............此处省略149个文件信息

评论

共有 条评论