zad3
user_1041599
c_cpp
2 months ago
368 B
1
Indexable
2kolok_SP
#include <iostream> #include <cctype> using namespace std; int main() { int n; cin >> n; int a[n]; for ( int i = 0; i < n; i++) { cin>>*(a+i); } int ind; cin>>ind; if (ind > n) cout<<0; else{ int sum = 0; for ( int i = ind; i < n; i++) { sum+=*(a+i); } cout<<sum; } }
Editor is loading...
Leave a Comment