fork(1) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. int l;
  6. char t;
  7. double matriz[12][12];
  8. double soma = 0.0;
  9.  
  10. cin >> l >> t;
  11.  
  12. for (int i = 0; i < 12; i++) {
  13.  
  14. for (int j = 0; j < 12; j++) {
  15. cin >> matriz[i][j];
  16. if (i == l) {
  17. soma += matriz[i][j];
  18. }
  19. }
  20. }
  21.  
  22. t == 'S';
  23. cout << soma << endl;
  24.  
  25. return 0;
  26. }
Success #stdin #stdout 0s 4420KB
stdin
2
S
0.0
-3.5
2.5
4.1
stdout
-nan