プロが教えるわが家の防犯対策術!

例に自分の名前、生年月日、年齢、住所を画面に表示するプログラムを作ってみてくれませんか?
そのプログラムのそれぞれの行にコメントを入れよと出てるんです
まだやったばかりで文字の出力法くらいしかやってないですが…
これどこが違うんですか
#include<iostream>
using namespace std;

int main() {//main関数を定義する

.... cout << "" ×○太郎 << endl ;//自分の名前
.... cout << "April 8, 19○○" << endl ;//生年月日
.... cout << "○○ years old" << endl ;//年齢
.... cout << "taitouku" << endl ;//住所を画面に表示
return 0;
}//main関数の終わり

そんな難しい事してないから、最初と最後の文はもうこれで行きます

A 回答 (2件)

文字列の出力は「"」で始まり、「"」で終わる必要があります。




#include <iostream>

using namespace std;

int main()
{
cout << "×○太郎" << endl;// 名前
cout << "April 8, 19 ○○" << endl;// 生年月日
cout << "○○ years old" << endl;// 年齢
cout << "taitouku" << endl;// 住所

return 0;
}
    • good
    • 0

??????????


cout<<"×○太郎"<<endl; では?
    • good
    • 0

お探しのQ&Aが見つからない時は、教えて!gooで質問しましょう!