2.7.1

#include<iostream>
int main() {
using namespace std;
char name[];
char address[];
cout << "input name :";
cin >> name;
cout << "input address:";
cin >> address;
cin.get();
cout << "name is " << name;
cout << endl;
cout << "address is " << address;
cin.get();
}

2.7.2

#include<iostream>
int main() {
using namespace std;
int distance;
cout << "input distance:";
cin >> distance;
cin.get();
cout << "long_distance is ";
cout << distance * ;
cin.get();
}

2.7.3

#include<iostream>
using namespace std;
void func_1();
void func_2();
int main() {
//cin.get();
func_1();
func_1();
func_2();
func_2();
cin.get();
}
void func_1() {
cout << "Three blind mice" << endl;
}
void func_2() {
cout << "See how they run" << endl;
}

2.7.4

#include<iostream>
int main() {
using namespace std;
int age;
cout << "Enter your age:";
cin >> age;
cin.get();
cout << age * ;
cin.get();
}

2.7.5

#include<iostream>
double convert(double);
int main() {
using namespace std;
double degrees;
cout << "Please enter a Celsius value: ";
cin >> degrees;
cin.get();
cout << degrees << " Celsius is " << convert(degrees) << " degrees Fahrenheit";
cin.get();
}
double convert(double degrees) {
double Fahrenheit = degrees*1.8 + 32.0;
return Fahrenheit;
}

2.7.6

#include<iostream>
double convert(double);
int main() {
using namespace std;
double light_years;
cout << "Enter the number of light years: ";
cin >> light_years;
cin.get();
cout << light_years << " light years = " << convert(light_years) << " astronomical units";
cin.get();
}
double convert(double light_years) {
double units = light_years * ;
return units;
}

2.7.7

#include<iostream>
void timer(int, int);
int main() {
using namespace std;
int hours, minutes;
cout << "Enter the number of hours: ";
cin >> hours;
cout << "Enter the number of minutes: ";
cin >> minutes;
cin.get();
timer(hours, minutes);
cin.get();
}
void timer(int hours, int minutes) {
std::cout << "Timer: " << hours << ":" << minutes;
}

最新文章

  1. C# Process.Start()方法详解
  2. Linux 网络配置
  3. Oracle读写分离架构
  4. 使用siege进行Web压力测试
  5. UVa 10106 Product
  6. IE6文字溢出BUG(多出来的猪问题)
  7. C++ Primer 练习7.32(C++ Primer读书笔记)
  8. Android 使用弹出对话框,报Unable to add window错误
  9. 实现SQLServer数据库转成MYSQL数据库
  10. JavaScript 函数之 ------------------ 闭包
  11. aspx中如何加入javascript
  12. Linux的kobject机制
  13. springboot(十六):springboot整合shiro
  14. odoo:开源 ERP/CRM 入门与实践 -- 上海嘉冰信息技术公司提供咨询服务
  15. css3 前端开发
  16. Casual Note of OS
  17. GDB十分钟教程 (链接)
  18. 【Keras学习】Sequential模型
  19. redis 绑定任意ip
  20. 【问题】 百度地图marker不在中心点处

热门文章

  1. vue 基础核心学习
  2. Oracle学习笔记—Oracle左连接、右连接、全外连接以及(+)号用法(转载)
  3. JAVA 遍历文件夹下文件并更改文件名称
  4. JAVA学习笔记----【转】 java.toString() ,(String),String.valueOf的区别
  5. Android 工具类 SharedPreferences 封装
  6. 流量分析系统---echarts模拟迁移中 ,geocoord从后台获取动态数值
  7. Loadrunder脚本篇——web_custom_request做接口测试
  8. python glob
  9. 标准输出:1&gt;,2&gt;,1&gt;&amp;2,2&gt;&amp;1
  10. Gitblit搭建及Git协作开发流程