20 求解
查看原帖
20 求解
105996
封禁用户楼主2018/10/20 21:40

#include<bits/stdc++.h> using namespace std; int n,a[3005], b[3005],k=0; int main() {

 //freopen("1452.in","r",stdin);
 //freopen("1452.out","w",stdout);
 cin>>n;
 for(int i=1;i<=n;i++)
 {
 	 cin>>a[i]>>b[i];
 }
 for(int i=2;i<=n;i++)
 {
 	 if(a[i]+b[i]>8)
 	 {
 	 	k+=a[i]+b[i]-8;
	 }
 }
 cout<<"-"<<k;
 

 return 0;

}

2018/10/20 21:40
加载中...