void main (void)
{
char name [2] [30], number [2] [10];
char << "Please type your first name, a blank, and last name) << endl;
cin >> name;
cout << "Name=" <<name << endl;
cout << "Please type a number, press the return key, and another number << endl;
cin >> number [0] >> endl;
cout << number << endl;
}
-5
A
回答
5
太多提及,但我们不是在这里充当家庭作业服务。检查你的编译器的输出,那么解决这些问题一次一个:
qq.cpp:4:13: warning: missing terminating " character
qq.cpp:4: error: missing terminating " character
qq.cpp:7:13: warning: missing terminating " character
qq.cpp:7: error: missing terminating " character
qq.cpp:1: error: ‘::main’ must return ‘int’
qq.cpp: In function ‘int main()’:
qq.cpp:4: error: expected unqualified-id before ‘<<’ token
qq.cpp:6: error: ‘cout’ was not declared in this scope
qq.cpp:6: error: ‘endl’ was not declared in this scope
qq.cpp:8: error: ‘cin’ was not declared in this scope
在最低限度:
- 没有
using
条款或std::
前缀。 char
不是流。- 对某些字符串文字没有关闭引号。
1
有在"Please type your first name, a blank, and last name)
+0
也许有太多的事情要抱怨。 – Phonon 2011-05-19 13:51:48
1
末括号,而不是一个双引号你不结束与“在
char << "Please type your first name, a blank, and last name) << endl;
和
cout << "Please type a number, press the return key, and another number << endl;
字符串
它应该是:
int main (void)
{
char name [2] [30], number [2] [10];
char << "Please type your first name, a blank, and last name)" << endl;
cin >> name;
cout << "Name=" <<name << endl;
cout << "Please type a number, press the return key, and another number" << endl;
cin >> number [0] >> endl;
cout << number << endl;
return 0;
}
1
char << "Please type your first name, a blank, and last name) << endl;
和
cout << "Please type a number, press the return key, and another number << endl;
都缺少结束双引号
char << "Please type your first name, a blank, and last name)" << endl;
cout << "Please type a number, press the return key, and another number" << endl
+0
第一个可能有_else_错误:-)提示,'char'是一个关键字。 – paxdiablo 2011-05-19 13:55:48
相关问题
- 1. 这段代码的错误是什么?
- 2. 这段代码的错误是什么?
- 3. 这段代码中的错误是什么,为什么?
- 4. 这段代码中导致段错误的原因是什么?
- 5. javascript - 这段代码有什么错误?
- 6. 这段代码有什么错误?
- 7. 这段代码有什么错误?
- 8. 什么错误++这段代码在C
- 9. 这段代码中运行时错误的原因是什么?
- 10. 这段代码中的错误检查点是什么?
- 11. 这段代码中的错误是什么?
- 12. 这段代码中的错误是什么?
- 13. 这段代码中的错误是什么?
- 14. 这段代码中的变量可见性错误是什么?
- 15. 这段代码在Python中的语法错误是什么?
- 16. 这段代码中的错误是什么?
- 17. 这段代码中导致ArrayIndexOutOfBounds错误的原因是什么?
- 18. 这个sql代码段中的语法错误是什么?
- 19. 这段代码中的指针错误是什么?
- 20. 这段代码中的错误是什么?
- 21. 这段代码是什么?
- 22. 为什么编程MongoDB中运行这段代码是错误
- 23. 这段代码中的T是什么
- 24. 这段代码中的memPtr是什么?
- 25. 什么是这个代码错误
- 26. 这是什么错误代码? -2147220717(0x80040313)
- 27. 什么是导致此C代码中的段错误错误?
- 28. 这段java代码为什么会给我这么多错误?
- 29. 这段代码中的IEventRepository是什么? Resolver.resolve()是做什么的?
- 30. 这段代码的目的是什么?
我发现了错误:'无效的主要(无效)' – 2011-05-19 13:50:53
这是新定义的经典范例“过于本土化”:这个问题不可能永远帮助未来的访问者;它只与一个小的地理区域,一个特定的时刻或一个非常狭窄的情况有关,而这种情况通常不适用于全球互联网用户。 – paxdiablo 2011-05-19 13:53:43
还有人还在乎回答他们? :-) – 2011-05-19 14:03:03