We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6c5cab6 commit 4ce8532Copy full SHA for 4ce8532
38A - Army.cpp
@@ -0,0 +1,30 @@
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
+ int arr[n-1];
11
+ for(int i=0;i<n-1;i++)
12
+ {
13
+ cin>>arr[i];
14
+ }
15
+ int a,b;
16
+ cin>>a>>b;
17
+ int ans=0;
18
+ for(int i=a-1;i<b-1;i++)
19
20
+ ans+=arr[i];
21
22
+ cout<<ans<<endl;
23
+}
24
25
26
27
28
29
30
0 commit comments