C++学习笔记
来源:互联网 发布:linux制作iso镜像 编辑:程序博客网 时间:2024/05/29 16:30
2016年12月27日
2.4.3 用户定义函数
// ourfun.cpp -- define your own function#include<iostream>void simon(int); // function protype for simon()int main(){ using namespace std; simon(4); // call the simon() funciton cout<< "Pick an interger:"; int count; cin>> count; simon(count); // call it again cout<< "Done!"<<endl; return 0;}void simon(int n){ using namespace std; cout<<"Simon says touch your toes" << n <<" times." << endl;} // void function don't need return stament
// convert.cpp --- converts stone to pounds#include<iostream>int stonetolb(int); // function prototypeint main(){ using namespace std; int stone; cout<<"Enter the weight in stone."; cin>>stone; int pounds = stonetolb(stone); cout<<stone<<"stone="; cout<<pounds<<"pounds."<<endl; return 0;}int stonetolb(int sts){ return 14*sts;}
0 0
- C++/C学习笔记
- 【C/C++】STL学习笔记
- C/C学习笔记/导言
- C/C学习笔记/结构
- 【c/c++】学习笔记1
- C学习笔记1
- TPC-C学习笔记
- c语言学习笔记
- C语言学习笔记
- C语言学习笔记
- 学习笔记之c
- C#-学习笔记
- Objective-C学习笔记
- C++PRIMER学习笔记
- C学习笔记
- C 学习笔记
- C/C++学习笔记
- 1.C学习笔记
- c# asp.net excel导出 80070005 拒绝访问
- 自定义View之TextView的闪动效果
- MMU用法
- redis 基本操作
- 深度学习框架Caffe源码解析
- C++学习笔记
- grails框架入门小结(三)—Maven+Git+Dubbo+Zookeeper
- vs2008 vs2010 vs2015 菜单栏消失及恢复
- runC源码分析——主体调用链
- BZOJ 1497 最大权闭合子图
- 驽马十驾,功在不舍
- 专业与侍奉,双职侍奉 --- 黄立夫教授的体会与分享(转载)
- ASP.NET C# 过滤器
- Microsoft Visual studio2013如何编写文本代码