作者aldreamp (孟仔)
看板NTUBIME100HW
标题[C++ ] C++第三题检验跳出!!
时间Wed Dec 12 10:34:09 2007
#include "stdafx.h"
#include "iostream"
#include "conio.h"
#include <string>
using namespace std;
void change(string a);
void main()
{
char check='0';
do{
string a;
getline(cin,a);
change(a);
cout<<"enter 1 to quit, or press any key to continue typing below!";
check=getch();
cout<<endl;
}while(check!='1');
}
void change(string a)
{
int i=0;
for(i=a.length()-1;i>=0;i--)
{
cout<<a[i];
}
cout<<endl;
}
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 140.112.4.234
1F:推 Pineapple225:问一下喔! 题目不是说要按ctrl+z跳出吗?? 12/12 13:19
2F:→ Pineapple225:没事~~~我问了蠢问题= = 12/12 22:35