完善程序:
(求字符的逆序)下面的程序的功能是输入若干行字符串,每输入一行,就按逆序输出该行,最后键入 −1 终止程序。请将程序补充完整。
#include <iostream.h> #include <string.h> int maxline = 200, kz; int reverse( char s[] ) { int i, j, t; for ( i = 0, j = strlen( s ) - 1; i < j; 【①】 , 【②】 ) { t = s[i]; s[i] = s[j]; s[j] = t; } return(0); } int main() { char line[100]; cout << "continue? -1 for end." <<endl; cin>>kz; while(【③】) { cin >> line; 【④】; cout << line << endl; cout << "continue ? -1 for end." << endl; cin >> kz; } }