TOPIC

está dando erro de 15% e não consigo ver esse erro

FERNANDO MANICUCCI LOPES GUEDES FILHO asked 1 year ago

include

using namespace std; int main() { double M[12][12], s = 0.0; char op; cin >> op; for(int i = 0; i < 12; i++) { for(int j = 0; j < 12; j++) { cin >> M[i][j]; if(j > (11 - i) && j > i) { s += M[i][j]; } } } if(op == 'S') { cout << s << endl; } else { if(op == 'M') { cout << s/30.0 << endl; } } }

Remember not post solutions. Your post may be reviewed by our moderators.

  • feodorv replied 1 year ago

    The problem states that you should print the calculated result (sum or average)

    with one digit after the decimal point.