#include <iostream> using namespace std; int main() { int n; double a,b,res=0; cin>>n; for(int i=0;i<n;i++){ cin>>a>>b; res+=a*b; } cout<<res; return 0;}
5 1.0 12.0 0.7 5.2 0.9 10.7 0.5 20.4 0.2 30.0
41.47
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!