私は今脳ショックを受けているので、非常に簡単な質問をしたいと思いました。
現在、私はこのようなスタートを印刷しようとしています
入力が7の場合、出力は
*
**
*
**
*
**
*
そして、ここで私のコードは、7回ではなく14回印刷されるか、入れN/2
ても奇数は印刷されません。
#include <iostream>
using namespace std;
int main () {
int N;
cout << " Please enter N " ;
cin >> N;
for (int i = 0; i < N ; i++) {
cout << "*" << endl;
for (int j = 0; j < 2; j++) {
cout << "*" ;
}
cout << endl;
}
}