📄 pr17003.cpp
字号:
////////////////////////////////////////
// File Name: pr17003.cpp
////////////////////////////////////////
#include <iostream>
int main()
{
char line[25], ch = 0, *cp;
std::cout << " Type a line terminated by 'x'"
<< std::endl << '>';
cp = line;
while (ch != 'x')
{
std::cin >> ch;
*cp++ = ch;
}
*cp = '\0';
std::cout << ' ' << line;
std::cout << "\n Type another one" << std::endl << '>';
cp = line;
ch = 0;
while (ch != 'x')
{
std::cin.get(ch);
*cp++ = ch;
}
*cp = '\0';
std::cout << ' ' << line;
return 0;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -