[C++ ] C++第三題檢驗跳出!!
#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
推
12/12 13:19, , 1F
12/12 13:19, 1F
→
12/12 22:35, , 2F
12/12 22:35, 2F