UVA solution :12696 - Cabin Baggage

// Uva userid:deepitauiu // link:https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&category=0&problem=4434 #include<bits/stdc++.h> using namespace std; int main() { int t,i,j,k,flag=1,total=0; float length, width, depth ,weight; cin>>t; while(t--){ cin>>length>>width>>depth>>weight; if(weight<=7.00){ if(length<=56 && width <=45 && depth<=25) { flag=1; } else if(length+width+depth<=125 ) { flag=1; } else flag=0; } else{ flag=0; } cout<<flag<<endl; total+=flag; } cout<<total<<endl; return 0; }

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.