33,311
社区成员
发帖
与我相关
我的任务
分享
#include <string.h>
#include <iostream>
using namespace std;
#define N (200)
// 假设函数是这样
void Ccode(char code[])
{
cout << code << endl;
}
int main()
{
char ch[50];
char code[N];
while(1)
{
cout << "input ch~~~~~~~~~~~1\n";
//gets(ch);
cin.getline(ch, 50);
if(strcmp(ch,"START")==0)
{
cout << "input code~~~~~~~~~~~1\n";
cin.getline(code,N);
}
else if(strcmp(ch,"ENDOFINPUT")==0)
break;
cout << "input ch~~~~~~~~~~~2\n";
//gets(ch);
cin.getline(ch, 50);
if(strcmp(ch,"END")==0)
{
Ccode(code);
}
}
return 0;
}