例に自分の名前、生年月日、年齢、住所を画面に表示するプログラムを作ってみてくれませんか?
そのプログラムのそれぞれの行にコメントを入れよと出てるんです
まだやったばかりで文字の出力法くらいしかやってないですが…
これどこが違うんですか
#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関数の終わり
そんな難しい事してないから、最初と最後の文はもうこれで行きます
No.2ベストアンサー
- 回答日時:
文字列の出力は「"」で始まり、「"」で終わる必要があります。
#include <iostream>
using namespace std;
int main()
{
cout << "×○太郎" << endl;// 名前
cout << "April 8, 19 ○○" << endl;// 生年月日
cout << "○○ years old" << endl;// 年齢
cout << "taitouku" << endl;// 住所
return 0;
}
お探しのQ&Aが見つからない時は、教えて!gooで質問しましょう!
関連するカテゴリからQ&Aを探す
おすすめ情報
- ・漫画をレンタルでお得に読める!
- ・人生のプチ美学を教えてください!!
- ・10秒目をつむったら…
- ・あなたの習慣について教えてください!!
- ・牛、豚、鶏、どれか一つ食べられなくなるとしたら?
- ・【大喜利】【投稿~9/18】 おとぎ話『桃太郎』の知られざるエピソード
- ・街中で見かけて「グッときた人」の思い出
- ・「一気に最後まで読んだ」本、教えて下さい!
- ・幼稚園時代「何組」でしたか?
- ・激凹みから立ち直る方法
- ・1つだけ過去を変えられるとしたら?
- ・【あるあるbot連動企画】あるあるbotに投稿したけど採用されなかったあるある募集
- ・【あるあるbot連動企画】フォロワー20万人のアカウントであなたのあるあるを披露してみませんか?
- ・映画のエンドロール観る派?観ない派?
- ・海外旅行から帰ってきたら、まず何を食べる?
- ・誕生日にもらった意外なもの
- ・天使と悪魔選手権
- ・ちょっと先の未来クイズ第2問
- ・【大喜利】【投稿~9/7】 ロボットの住む世界で流行ってる罰ゲームとは?
- ・推しミネラルウォーターはありますか?
- ・都道府県穴埋めゲーム
- ・この人頭いいなと思ったエピソード
- ・準・究極の選択
デイリーランキングこのカテゴリの人気デイリーQ&Aランキング
-
switch文のエラーについて
-
構文エラーが出ているのですが...
-
#include "fstream.h"
-
setw
-
gccでコンパイル時のエラー
-
enumの値から定義名を文字列化...
-
構造体配列のvectorへの変換と...
-
wstringの内容を表示させたい
-
空ENTERの判別
-
VC++で文字列から任意の文字を...
-
#define中の#のエスケープ
-
string型の固定長文字列を配列...
-
#defineの使い方について
-
指定した文字を削除したい
-
C++でのmath.hやstdio.hの使用...
-
OpenCVでRAW画像(カラー)を開...
-
_tcscat がうまくいきません(V...
-
vc++の使い方について
-
CStringとString
-
修正箇所の指摘のお願い(文字列...
マンスリーランキングこのカテゴリの人気マンスリーQ&Aランキング
-
switch文のエラーについて
-
構文エラーが出ているのですが...
-
なぜ、C++の標準ヘッダをインク...
-
gccでコンパイル時のエラー
-
空ENTERの判別
-
【C++】ヘッダ内でstringを格納...
-
snprintfが使用できない。
-
enumの値から定義名を文字列化...
-
#include "fstream.h"
-
C++で、テキストファイルを一行...
-
std::wstringのメモリリークに...
-
C++での <iostream.h>と<iostre...
-
VC++で文字列から任意の文字を...
-
#defineの使い方について
-
wstringの主力
-
vc++の使い方について
-
std::map の const 修飾について
-
string型のフォーマット書式指...
-
構造体配列のvectorへの変換と...
-
指定した文字を削除したい
おすすめ情報