質問編集履歴

1

一部訂正いたしました

2021/02/24 13:57

投稿

yukiiwashiro
yukiiwashiro

スコア0

test CHANGED
File without changes
test CHANGED
@@ -7,6 +7,10 @@
7
7
  ビジュアルスタジオをつかってC++の課題をしているのですが、
8
8
 
9
9
  coutで文字入力を行った直後ディバックがなぜか終了してしまいます。
10
+
11
+
12
+
13
+ このプログラムは、2つの数字を入れて頂いて、その一つ目を二進数で表すものなのですが、2つ目の数字をいれた途端にディバックが終了し、2進数が表示されません。
10
14
 
11
15
 
12
16
 
@@ -74,11 +78,11 @@
74
78
 
75
79
  cout << endl << endl;
76
80
 
77
- cout << endl << "\tEnter an unsigned integer: ";
81
+ cout << endl << "\tいくつかの数字を入力してください: ";
78
82
 
79
83
  while (!(cin >> LocInt3)) {
80
84
 
81
- cout << "\tInvalid input; reenter: ";
85
+ cout << "\t正しくないです: ";
82
86
 
83
87
  cin.clear();
84
88
 
@@ -90,7 +94,7 @@
90
94
 
91
95
  LocInt1 = LocInt3 * -1L;
92
96
 
93
- cout << "\tYou entered a negative value; converting to positive: " << LocInt1 << endl << endl;
97
+ cout << "\tマイナスが入力されました; プラスにへんこうします: " << LocInt1 << endl << endl;
94
98
 
95
99
  }
96
100
 
@@ -98,7 +102,7 @@
98
102
 
99
103
  LocInt1 = LocInt3;
100
104
 
101
- cout << "\tYou entered: " << LocInt1 << endl << endl;
105
+ cout << "\tあなたが入力した数字は: " << LocInt1 << endl << endl;
102
106
 
103
107
  }
104
108
 
@@ -116,13 +120,13 @@
116
120
 
117
121
  if(LocInt2 < LocInt1){
118
122
 
119
- cout << "\tEnter value should greater than the first integer: ";
123
+ cout << "\t1回目よりも大きな数字にして下さい: ";
120
124
 
121
125
  }
122
126
 
123
127
  else {
124
128
 
125
- cout << "\tInvalid input; reenter: ";
129
+ cout << "\t正しくないです; reenter: ";
126
130
 
127
131
  }
128
132
 
@@ -136,7 +140,7 @@
136
140
 
137
141
  LocInt4 = LocInt2 * -1L;
138
142
 
139
- cout << "\tYou entered a negative value; converting to positive: " << LocInt4 << endl << endl;
143
+ cout << "\tマイナスが入力されました; プラスにへんこうします: " << LocInt4 << endl << endl;
140
144
 
141
145
  }
142
146
 
@@ -144,7 +148,7 @@
144
148
 
145
149
  LocInt4 = LocInt2;
146
150
 
147
- cout << "\tYou entered: " << LocInt4 << endl << endl;
151
+ cout << "\tあなたが入力した数字は: " << LocInt4 << endl << endl;
148
152
 
149
153
 
150
154
 
@@ -152,25 +156,15 @@
152
156
 
153
157
 
154
158
 
155
- long long LocIntSum;
156
-
157
- LocIntSum = LocInt4 + LocInt1;
158
-
159
- cout << LocIntSum;
160
-
161
-
162
-
163
159
 
164
160
 
165
161
  cout << "First Integer";
166
162
 
167
- cout << << binary(LocInt1) << endl;
163
+ cout << "2進数に変換した数値は:" << binary(LocInt1) << endl;
168
164
 
169
165
  return 0;
170
166
 
171
167
 
172
-
173
- }
174
168
 
175
169
  ```
176
170