关于cout的问题,请帮忙,这很紧急 [英] Problem with cout, please help, it's urgent
问题描述
main(){
cout<<"" Hello World";
}
此输出将是:Hello World
但是我们可以输出嗨! Hello World没有修改main()中的代码?
任何人都可以帮我解决这个问题吗?
main(){
cout<<"Hello World";
}
This output will be : Hello World
But can we output "Hi! Hello World" without modifying the code in main()?
Can anyone help me out of this?
推荐答案
main(){
cout<<"" Hello World";
}
此输出将为:Hello World
但是我们可以输出嗨! Hello World没有修改main()中的代码?
有谁可以帮我解决这个问题?
main(){
cout<<"Hello World";
}
This output will be : Hello World
But can we output "Hi! Hello World" without modifying the code in main()?
Can anyone help me out of this?
不,无论主要是什么,将会执行什么。如果你想输出:嗨! Hello World",只需输入" cout<< "嗨! Hello World" ;;。 cout在<<<<"之后打印出任何内容。这就是你需要的吗?
No, whatever is in main that is what is going to be executed. If you want to output: "Hi! Hello World", just put "cout << "Hi! Hello World";. cout prints out anything after "<<". Is that what you need?
不,无论是什么在主要的是什么将被执行。如果你想输出:嗨! Hello World",只需输入" cout<< "嗨! Hello World" ;;。 cout在<<<<"之后打印出任何内容。这就是你需要的吗?
No, whatever is in main that is what is going to be executed. If you want to output: "Hi! Hello World", just put "cout << "Hi! Hello World";. cout prints out anything after "<<". Is that what you need?
我们不能在不打扰main()函数的情况下编写任何内容吗? main()之外的东西。
Can''t we write anything without disturbing the main() function ? Something outside main().
我们不能在不干扰main()函数的情况下编写任何内容吗? main()之外的东西。
Can''t we write anything without disturbing the main() function ? Something outside main().
你可以创建自己从main调用的函数,但程序中发生的所有事情都是从main开始的。这就是程序开始的地方。
Well you can create your own function that you call from main, but everything that happens in a program starts from main. That''s where the program starts.
这篇关于关于cout的问题,请帮忙,这很紧急的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!