博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
C++ work 1 switch and while
阅读量:4538 次
发布时间:2019-06-08

本文共 758 字,大约阅读时间需要 2 分钟。

work

  • switch
#include
using namespace std;int main(){ int i; cout<<"please enter one member 1 to 7..."<
>i; if(i<1||i>7) { cout<<"input error,out of range...please input again..."<
7); switch(i) { case 1: case 2: case 3: case 4: case 5: cout<<"workday,let's work hard\n"<

1350350-20180314204512841-1938046394.png

  • while
#include
using namespace std;int main(){ int i; int answer=0; cout<<"please input a number "<
>i; while(i!=0) { answer*=10; answer+=i%10; i/=10; } cout<<"answer is "<
<

1350350-20180314204537597-431160097.png

转载于:https://www.cnblogs.com/flyingbrid-nest/p/8569972.html

你可能感兴趣的文章
android 按menu键解锁功能的开关
查看>>
wpf 自定义窗口,最大化时覆盖任务栏解决方案
查看>>
Linux 下的dd命令使用详解
查看>>
POJ-1273 Drainage Ditches 最大流Dinic
查看>>
ASP.NET学习记录点滴
查看>>
uva 12097(二分)
查看>>
[Noip2016] 愤怒的小鸟
查看>>
Linux系统基础管理
查看>>
JAVA wait()和notifyAll()实现线程间通讯
查看>>
python全栈脱产第11天------装饰器
查看>>
koa2 从入门到进阶之路 (一)
查看>>
Java / Android 基于Http的多线程下载的实现
查看>>
求职历程-----我的简历
查看>>
[总结]数据结构(板子)
查看>>
网页图片加载失败,用默认图片替换
查看>>
C# 笔记
查看>>
2013年10月13日学习:SQL通过命令语句来创建表
查看>>
剑指offer : 二维数组中的查找
查看>>
第三章 python基础
查看>>
java基础题
查看>>