帮我看看这个C++程序错在哪里
来源:百度知道 编辑:UC知道 时间:2024/06/22 09:02:30
#include<stdio.h>
void main()
{
void reverse()
{
char ch=getchar();
if(ch!='\n')
{
reverse();
cout>>ch;
}
}
}
void main()
{
void reverse()
{
char ch=getchar();
if(ch!='\n')
{
reverse();
cout>>ch;
}
}
}
```你的函数定义写在main()函数外面啊···cout符号反的
void reverse()
{
char ch=getchar();
if(ch!='\n')
{
//reverse(); 不懂你要在这里调用是什么意思
cout << ch;
}
}
void main()
{
reverse();
}
子函数定义位置不对
void reverse()
{
char ch=getchar();
if(ch!='\n')
{
reverse();
cout>>ch;
}
}
void main()
{
reverse();
}
#include<iostream.h>//如果你用cout 就要这个头文件,否则你就应该printf
#include <stdio.h>
void reverse()
{
char ch=getchar();
if(ch!='\n')
{
cout<<ch; //是<< 不是>>
}
}
void main()
{
reverse(); //函数定义应该在main外面 - -!
}