fork download
  1. #include <iostream>
  2.  
  3. #include <vector>
  4.  
  5. #include <string>
  6. #include <utility>
  7.  
  8. #define mp make_pair
  9.  
  10. using namespace std;
  11.  
  12. inline float h(float xi, pair<float, float>& theta)
  13. { return theta.first+theta.second*xi; }
  14.  
  15. int main()
  16. {
  17. cout<<"Hello World!!"<<endl;
  18.  
  19. int m=0;
  20. cin>>m;
  21.  
  22. vector<string> compounds(m, "");
  23. vector<int> x_count_carbon(m, 0);
  24. vector<float> y_energy(m, 0);
  25.  
  26. int i=0;
  27. for(i=0; i<m; ++i)
  28. cin>>compounds[i]>>x_count_carbon[i]>>y_energy[i];
  29.  
  30. // Debug
  31. for(i=0; i<m; ++i)
  32. cout<<compounds[i]<<" "<<x_count_carbon[i]<<" "<<y_energy[i]<<endl;
  33.  
  34. return 0;
  35. }
Success #stdin #stdout 0s 16064KB
stdin
12
methane 1 -890
ethene 2 -1411
ethane 2 -1560
propane 3 -2220
cyclopropane 3 -2091
butane 4 -2878
pentane 5 -3537
benzene 6 -3268
cyclohexane 6 -3920
hexane 6 -4163
octane 8 -5471
nepthalene 10 -5157
stdout
Hello World!!
methane 1 -890
ethene 2 -1411
ethane 2 -1560
propane 3 -2220
cyclopropane 3 -2091
butane 4 -2878
pentane 5 -3537
benzene 6 -3268
cyclohexane 6 -3920
hexane 6 -4163
octane 8 -5471
nepthalene 10 -5157