summaryrefslogtreecommitdiff
path: root/11727/cost.cpp
diff options
context:
space:
mode:
Diffstat (limited to '11727/cost.cpp')
-rwxr-xr-x11727/cost.cpp27
1 files changed, 27 insertions, 0 deletions
diff --git a/11727/cost.cpp b/11727/cost.cpp
new file mode 100755
index 0000000..69dded2
--- /dev/null
+++ b/11727/cost.cpp
@@ -0,0 +1,27 @@
+#include <iostream>
+using namespace std;
+
+int main(){
+ int ct, x=0, ar[3], temp;
+ cin>>ct;
+ while(x<ct)
+ {
+ cin>>ar[0]>>ar[1]>>ar[2];
+ bool sorted=false;
+ while(!sorted)
+ for(int i=1;i<3;i++)
+ {
+ sorted=true;
+ if(ar[i]<ar[i-1])
+ {
+ sorted=false;
+ temp=ar[i-1];
+ ar[i-1]=ar[i];
+ ar[i]=temp;
+ }
+ }
+ cout<<"Case "<<x+1<<": "<<ar[1]<<endl;;
+ x++;
+ }
+}
+