[C++ ] 顛倒輸出

看板NTUBIME100HW作者 (Magic)時間18年前 (2007/12/06 23:53), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串1/1
#include "stdafx.h" #include <iostream> #include <string> using namespace std; void x (char input[255]); int _tmain(int argc, _TCHAR* argv[]) { char input[255]; cout<<""; gets(input); x(input); system("pause"); return 0; } void x (char input[255]) { int lenght=0; lenght=strlen(input); for(int i=0;i<lenght;i++) { cout<<input[lenght-1-i]; } } -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 140.112.240.138
文章代碼(AID): #17M1hfdg (NTUBIME100HW)