We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 12f738f commit 182ffbaCopy full SHA for 182ffba
629A - Far Relative’s Birthday Cake.cpp
@@ -0,0 +1,41 @@
1
+#include<bits/stdc++.h>
2
+using namespace std;
3
+
4
+// Code Written By: Vikash Patel
5
6
+int main()
7
+{
8
+ int n;
9
+ cin>>n;
10
+ char ch[n][n];
11
+ for(int i=0;i<n;i++)
12
+ {
13
+ for(int j=0;j<n;j++)
14
15
+ cin>>ch[i][j];
16
+ }
17
18
+ int ans=0, c=0;
19
20
21
22
23
+ c=0;
24
+ if(ch[i][j]=='C')
25
26
+ for(int k=i+1;k<n;k++)
27
28
+ if(ch[k][j]=='C')
29
+ c++;
30
31
+ for(int k=j+1;k<n;k++)
32
33
+ if(ch[i][k]=='C')
34
35
36
37
+ ans+=c;
38
39
40
+ cout<<ans<<endl;
41
+}
0 commit comments