if(gene1A[20] == 'T' || gene2A[20] == 'T')
outFile << "Person A is of 'Anemic' type." << endl;
else if(gene1A[20] == 'T' && gene2A[20] == 'T')
outFile << "Person A if of 'Carrier' type." << endl;
else
outFile << "Person A is of 'Normal' type." << endl;
if(gene1B[20] == 'T' || gene2B[20] == 'T')
outFile << "Person B is of 'Anemic' type." << endl;
else if(gene1B[20] == 'T' && gene2B[20] == 'T')
outFile << "Person B if of 'Carrier' type." << endl;
else
outFile << "Person B is of 'Normal' type." << endl;
if(gene1C[20] == 'T' || gene2C[20] == 'T')
outFile << "Person C is of 'Anemic' type." << endl;
else if(gene1C[20] == 'T' && gene2C[20] == 'T')
outFile << "Person C if of 'Carrier' type." << endl;
else
outFile << "Person C is of 'Normal' type." << endl;
if(gene1D[20] == 'T' || gene2D[20] == 'T')
outFile << "Person D is of 'Anemic' type." << endl;
else if(gene1A[20] == 'T' && gene2A[20] == 'T')
outFile << "Person D if of 'Carrier' type." << endl;
else
outFile << "Person D is of 'Normal' type." << endl;
今のところ私のコードです。私がする必要があるのは、私が設定した配列に基づいて、人が貧血、キャリア、または正常である場合、「outFile」を出力することです。各配列の長さは 444 文字で、A、C、T、または O のいずれかです。T が遺伝子 1[] および/または遺伝子 2[] の 20 番目の位置にある場合、その人は貧血 (配列が 1 つしかない場合) またはキャリア (両方のアレイの場合)。
私が今持っているものは、それらを自動的に「通常」にします。if ステートメントが適切に設定されていないと思いますが、必要なのは、配列の 20 番目の値を参照し、それが == 'T' の場合、それらの「型」を出力することです。
注: コードに 19 ではなく 20 を入れていることに気付きました。その修正を行ったので、それを過ぎて見てください。
みんなありがとう!