do-while()循环适合于运用在交互程序中,
- d0-while()循环妙用
- do
- { int val1,val2;
- cout<<"please enter two values";
- cin>>val1>>val2;
- cout<<"The sum of "<<val1<<"and"<<val2
- <<"="<<val1+val2<<"\n\n\n"
- <<"More ? [yes][no]";
- cin>>rsp;
- }while(!rsp.empty()&&rsp[0]!='n');
本文共 285 字,大约阅读时间需要 1 分钟。
do-while()循环适合于运用在交互程序中,
转载于:https://blog.51cto.com/jun0213/1047187