Skip to content

Commit 9d8ead7

Browse files
committed
1188 solve
1 parent 186cc6a commit 9d8ead7

File tree

3 files changed

+28
-9
lines changed

3 files changed

+28
-9
lines changed

10-Steps-to-Solve-Any-Problems.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@
99
7. Then optimize the real code.
1010
8. Take care of boundary conditions as well.
1111
9. Get feedback from your teammates, professors, and other developers and also ask your question on Stack Overflow if possible. Try to learn from others’ guidelines and what they are handling those problems. A problem may be solved in several ways. So, don’t get disappointed if you can’t think like an expert. You need to stick to the problem and you will gradually become better and quicker in solving problems like others.
12-
10. Practice, Practice, and Practice.
12+
10. Practice, Practice, and Practice.

Uri-online-judge/1188

16 KB
Binary file not shown.

Uri-online-judge/1188.cpp

+27-8
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,44 @@
1-
#include <iostream>
1+
#include <bits/stdc++.h>
22
using namespace std;
33
int main()
44
{
55
double N[12][12];
66
char p;
7+
int c=0, m=6, n=5;
78
double soma = 0.0;
89
cin >> p;
910
for (int i=0; i < 12; i++)
1011
{
11-
for (int j=0; i< 12; j++)
12+
for (int j=0; j < 12; j++)
1213
{
1314
cin >> N[i][j];
14-
if (j < (11 - i) && j < i)
15-
{
16-
soma +=N[i][j];
17-
}
15+
// if (j < (11 - i) && j < i)
16+
// if(i > 6)
17+
// {
18+
// soma +=N[i][j];
19+
// }
20+
1821
}
22+
1923
}
24+
int i=7;
25+
while(i<=11)
26+
27+
{
28+
for(int j = n; j<=m; j++){
29+
30+
soma = soma+N[i][j];
31+
32+
// c++;
33+
}
34+
m++;
35+
n--;
36+
i++;
37+
}
38+
2039
if (p=='S')
21-
cout << soma;
40+
cout<<fixed<<setprecision(1)<< soma<<endl;
2241
else
23-
cout << soma/30.00;
42+
cout << soma/30.00<<endl;
2443
return 0;
2544
}

0 commit comments

Comments
 (0)