//Problem link>>http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=24&page=show_problem&problem=4434
#include <bits/stdc++.h>
using namespace std ;
int main ()
{
double l, w , h , d , wgt ;
int t ,cnt=0 ;
cin>>t ;
while (t--)
{
d=0.0 ;
cin>>l>>w>>h>>wgt ;
d=l+w+h ;
if (l<=56.0 && w<=45.0 && h<=25.0)
{
if (d<=126.0 && wgt<=7.0)
{
cout<<"1"<<endl ;
cnt++ ;
}
else cout<<"0"<<endl ;
}
else
{
if (d<=125.0 && wgt<=7.0)
{
cout<<"1"<<endl ;
cnt++ ;
}
else cout<<"0"<<endl ;
}
}
cout<<cnt<<endl ;
return 0 ;
}
#include <bits/stdc++.h>
using namespace std ;
int main ()
{
double l, w , h , d , wgt ;
int t ,cnt=0 ;
cin>>t ;
while (t--)
{
d=0.0 ;
cin>>l>>w>>h>>wgt ;
d=l+w+h ;
if (l<=56.0 && w<=45.0 && h<=25.0)
{
if (d<=126.0 && wgt<=7.0)
{
cout<<"1"<<endl ;
cnt++ ;
}
else cout<<"0"<<endl ;
}
else
{
if (d<=125.0 && wgt<=7.0)
{
cout<<"1"<<endl ;
cnt++ ;
}
else cout<<"0"<<endl ;
}
}
cout<<cnt<<endl ;
return 0 ;
}
No comments:
Post a Comment