作者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
推 Pineapple225:問一下喔! 題目不是說要按ctrl+z跳出嗎?? 12/12 13:19
→ Pineapple225:沒事~~~我問了蠢問題= = 12/12 22:35