#include <iostream.h>
void main(void)
{
int age;
float salary;
char name[128];
cout << "Enter your first name age salary: ";
cin >> &name >> &age >> &salary;
cout << name << " " << age << " " << salary;
}
帮我找下该段程序的错误
答案:3 悬赏:80 手机版
解决时间 2021-04-21 18:08
- 提问者网友:蓝莓格格巫
- 2021-04-21 06:15
最佳答案
- 五星知识达人网友:愁杀梦里人
- 2021-04-21 06:42
#include <iostream.h>
void main(void)
{
int age;
float salary;
char name[128];
cout << "Enter your first name age salary: ";
cin >> name >> age >> salary;
cout << name << " " << age << " " << salary;
}
全部回答
- 1楼网友:走死在岁月里
- 2021-04-21 08:20
"cin >> &name >> &age >> &salary;"
改为"cin >> name >> age >> salary;"即可,你混用了scanf和cin的输入格式。在scanf中才用“&”。
- 2楼网友:一叶十三刺
- 2021-04-21 07:13
cin >> &name >> &age >> &salary;
改成
cin >> name >> age >> salary;
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯