设为首页 加入收藏

TOP

1.2 A First Look at Input/Output (4)
2013-10-07 16:13:41 来源: 作者: 【 】 浏览:96
Tags:1.2 First Look Input/Output

EXERCISES SECTION 1.2

Exercise 1.3: Write a program to print Hello, World on the standard output.

Exercise 1.4: Our program used the addition operator, +, to add two numbers. Write a program that uses the multiplication operator, *, to print the product instead.

Exercise 1.5: We wrote the output in one large statement. Rewrite the program to use a separate statement to print each operand.

Exercise 1.6: Explain whether the following program fragment is legal.

  1. std::cout << "The sum of " << v1;   
  2. << " and " << v2;   
  3. << " is " << v1 + v2 << std::endl;  

If the program is legal, what does it do If the program is not legal, why not How would you fix it

】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇1.2 A First Look at Input/Outpu.. 下一篇1.3 AWord about Comments (1)

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容:

·数据库:推荐几款 Re (2025-12-25 12:17:11)
·如何最简单、通俗地 (2025-12-25 12:17:09)
·什么是Redis?为什么 (2025-12-25 12:17:06)
·对于一个想入坑Linux (2025-12-25 11:49:07)
·Linux 怎么读? (2025-12-25 11:49:04)