为什么不管运行什么 都是Cpp1.exe - 1 error(s), 0 warning(s)比如 #include <stdio.h>
#include <iostream> int main()
{
printf("Hello world!"); // 教科书的写法
puts("Hello world!"); // 我最喜欢的
puts("Hello" " " "world!"); // 拼接字符串
std::cout < < "Hello world!" < < std::endl; // C++风格的教科书写法 return 0;
} 这个都出错。。。
C++为什么总是Cpp1.exe - 1 error(s), 0 warning(s)
答案:3 悬赏:40 手机版
解决时间 2021-02-14 16:01
- 提问者网友:斑駁影
- 2021-02-14 04:44
最佳答案
- 五星知识达人网友:舍身薄凉客
- 2021-02-14 05:19
#include <stdio.h>
#include <iostream>
int main()
{
printf("Hello world!"); // 教科书的写法
puts("Hello world!"); // 我最喜欢的
puts("Hello" " " "world!"); // 拼接字符串
std::cout << "Hello world!" << std::endl; // C++风格的教科书写法
return 0;
}
是cout <<不是< <,中间没有空格
#include <iostream>
int main()
{
printf("Hello world!"); // 教科书的写法
puts("Hello world!"); // 我最喜欢的
puts("Hello" " " "world!"); // 拼接字符串
std::cout << "Hello world!" << std::endl; // C++风格的教科书写法
return 0;
}
是cout <<不是< <,中间没有空格
全部回答
- 1楼网友:玩世
- 2021-02-14 06:38
#include <stdio.h>
#include <iostream>
int main()
{
printf("hello world!"); // 教科书的写法
puts("hello world!"); // 我最喜欢的
puts("hello" " " "world!"); // 拼接字符串
std::cout << "hello world!" << std::endl; // c++风格的教科书写法
return 0;
}
是cout <<不是< <,中间没有空格
- 2楼网友:不想翻身的咸鱼
- 2021-02-14 06:14
std::cout < < "Hello world!" < < std::endl; // C++风格的教科书写法, <<是这样的不是有空格的。也要注意中英语的输入法。std:cout<<"hello world!"<<std:endl;或者在最前面加上using namespace std;
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯