帮我看看一段C++小程序不执行循环体

来源:百度知道 编辑:UC知道 时间:2024/05/23 19:52:31
#include<iostream>
int main()
{
using namespace std;
char ch;
cout << "type,and i shall repeat:\n";

while(cin.get(ch)='.')
{
if(ch=='\n')
cout << ch;
else
cout << ++ch;
cin.get(ch);
}
cout << "\ni hope suc\n";
return 0
}

#include<iostream>
using namespace std;

int main()
{
using namespace std;
char ch;
cout << "type,and i shall repeat:\n";

while( (ch = cin.get()) !='.')
{
if(ch=='\n')
cout << ch;
else
cout << ++ch;
cin.get(ch);
}
cout << "\ni hope suc\n";
return 0 ;
}