2.7 输出地址和姓名(1
 #include <iostream>
 using namespace  std;
 int main()
 {
     int 距离;
     cout << "请输入距离" << endl;
     cin >> 距离;
     cout <<  << "码" << endl;

 }
     

2.7 转换距离(2)

 #include <iostream>
 using namespace  std;

 int main()
 {
     cout << "输入你的年龄\n";
     int age;
     cin >> age;
     cout <<  <<"ge月"<< endl;

     cin.get();
 }
     

2.7: 年龄(4)

 #include <iostream>
 using namespace  std;
 void c()
 {
     cout << "俺叫胡图图,家住翻斗花园\n俺叫胡图图,家住翻斗花园\n";

 }
 void cc()
 {
     cout << "那一夜的雨下的好大\n那一夜的雨下的好大\n";

 }

 int main()
 {
     c();
     cc();

     cin.get();
 }
     

2.7: 用3个函数输出2行语句(3)

 #include <iostream>
 using namespace  std;

 float 温度(int c)
 {
     return (c *= 1.8) + 32.0;

 }

 int main()
 {
     cout << "输入你的摄氏温度\n";
     int a;
     cin >> a;
     cout << "当前温度:" << 温度(a) << endl;

     cin.get();
 }
     

2.7 温度(5)

c++primer练习题的更多相关文章

  1. C++ Primer练习题day2

    /* 1.7略 1.8 /* 指出不合法的语句: std::cout<<"/"; std::cout<<"*/ "; std::cout ...

  2. C++ Primer练习题day1

    /* 练习1.1略 练习1.2.改写程序,让他返回-1. 练习1.3.编写程序,在标准的输出上打印Hello,World. */ #include<iostream> int main() ...

  3. C/C++:多个.cpp文件包括同一个.h头文件定义方法

    本文解决multiple definition of `XX'的错误.[出于反爬虫的目的,你不是在http://blog.csdn.net/zhanh1218上看到的,肯定不是最新最全的.] 关于头文 ...

  4. C++PRIMER第五版练习题答案第一章

    C++PRIMER第五版练习题答案第一章 应该有很多小伙伴和我一样,闲来无事买了本C++的书自己啃,课后的练习题做的很揪心,这里我分享下我写的答案,希望能帮助到你,提供源码,就不跑了哈,毕竟现在是第一 ...

  5. C primer plus 练习题 第七章

    1. #include <stdio.h> #define SPACE ' ' #define NEWLINE '\n' int main() { int spaces,newlines, ...

  6. C primer plus 练习题 第六章

    16. #include <stdio.h> int main() { double remain = 100.0; ; ) { remain = remain * 0.08 + rema ...

  7. C primer plus 练习题 第五章

    1. #include <stdio.h> #define MINU 60 int main() { int minute, hour, m; printf("请输入分钟:&qu ...

  8. C primer plus 练习题 第三章

    5. #include <stdio.h> int main() { float you_sec; printf("请输入你的年龄:"); scanf("%f ...

  9. C primer plus 练习题 第二章

    6. #include <stdio.h> void echo(); int main() { /* echo(); echo(); echo(); printf("\n&quo ...

随机推荐

  1. 【spring boot】SpringBoot初学(1) - Hello World

    前言 此文只是记录自己简单学习spring boot的笔记.所以,文章很多只是初步理解,可能存在严重错误. 一.Spring boot的初步理解 1.spring boot的目标 (摘自:spring ...

  2. python scraping webs - python取得NIPS oral paper列表

    from lxml import html import requests # using xpath # page = requests.get('http://econpy.pythonanywh ...

  3. 代数式转换为c语言表达式(很简单)

  4. 微信小程序调起支付API

    官方文档: https://pay.weixin.qq.com/wiki/doc/api/wxa/wxa_api.php?chapter=7_7 https://developers.weixin.q ...

  5. 我的翻译--一个针对TP-Link调试协议(TDDP)漏洞挖掘的故事

    前言 我写这篇文章原本是为了简化WiFi渗透测试研究工作.我们想使用去年由Core Security发布的WIWO,它可以在计算机网络接口和WiFi路由器之间建立一个透明的通道. 研究的第一步,就是选 ...

  6. BZOJ3172&&lg3966 TJOI单词(广义后缀自动机)

    BZOJ3172&&lg3966 TJOI单词(广义后缀自动机) 题面 自己找去 HINT 给出多个文本串,让你查找每个文本串一共出现了多少次,广义后缀自动机建出parent tree ...

  7. Python instagram 爬虫项目

    直接介绍一下具体的步骤以及注意点: instagram 爬虫注意点 instagram 的首页数据是 服务端渲染的,所以首页出现的 11 或 12 条数据是以 html 中的一个 json 结构存在的 ...

  8. archlinux install.txt

    ++++++ 注意事项+++ +++++++++++++++++++++++++++ 强烈建议新手移步 Arch Wiki > 新手指南 经验者请参阅 Arch Wiki > 安装指南 若 ...

  9. spring框架中用到了哪些设计模式

    1.代理模式:在AOP和remoting中被用的比较多 2.单例模式:在spring配置文件中定义的bean默认为单例模式 3.模板方法模式:解决代码重复问题 4.前端控制器模式:spring提供了D ...

  10. H3C接口管理配置

    一.接口批量配置 当多个接口需要配置某功能(比如shutdown)时,需要逐个进入接口视图,在每个接口执行一遍命令,比较繁琐.此时,可以使用接口批量配置功能,对接口进行批量配置,节省配置工作量. 1. ...