CCF 202012-1 期末预测之安全指数
#include <iostream> //#include <bits/stdc++.h> #include <string> using namespace std; int main() { int number; cin>>number; int sum=0; int a,b; while(number--) { cin>>a>>b; sum+=a*b; } sum=max(sum,0); cout<<sum; }
#include <iostream> //#include <bits/stdc++.h> #include <string> using namespace std; int main() { int number; cin>>number; int sum=0; int a,b; while(number--) { cin>>a>>b; sum+=a*b; } sum=max(sum,0); cout<<sum; }