Solution of URI 1189 :: Left Area ~Try Yourself First
uri 1189 - uri 1189 solution || URI problem 1182 solution in C | (Column in Array) - Code , ||
2060 - Problem - solve - Code: uri , Solution of URI 1182 :: Column in Array ~try Yourself first , 1189 - Left Area Solve #solution #coding #uri - URI Online Judge uri 1189 solution uri 1189 solution in c www uri uri problem solution uri o uri online judge3 uri program uri academic
Problem Details: Click Here for full problem...
1189 - Left Area Solve #solution |
Solution in c++:
#include <iostream>
#include<iomanip>
using namespace std;
int main()
{
char O;
double M[12][12];double sum=0.0;
cin>>O;
for(int i=0;i<=11;i++){
for(int j=0;j<=11;j++){
cin>>M[i][j];
if(j<(11-i) && j<i){ sum = sum+M[i][j];}
}
}
if(O== 'S') cout<<fixed<<setprecision(1)<<sum<<endl;
else if(O== 'M') cout<<fixed<<setprecision(1)<<(sum/66.0)<<endl;
//cout << "Hello world!" << endl;
return 0;
}
#include<iomanip>
using namespace std;
int main()
{
char O;
double M[12][12];double sum=0.0;
cin>>O;
for(int i=0;i<=11;i++){
for(int j=0;j<=11;j++){
cin>>M[i][j];
if(j<(11-i) && j<i){ sum = sum+M[i][j];}
}
}
if(O== 'S') cout<<fixed<<setprecision(1)<<sum<<endl;
else if(O== 'M') cout<<fixed<<setprecision(1)<<(sum/66.0)<<endl;
//cout << "Hello world!" << endl;
return 0;
}
Comments
Post a Comment
Thanks for your message