Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string.h>
- using namespace std ;
- typedef long long ll ;
- int main() {
- ios::sync_with_stdio(false) ; cout.tie(NULL) ; cin.tie(NULL) ;
- int n , sum = 0 ;
- cin >> n ;
- char arr[n] ;
- for (int i = 0; i < n; i++) cin >> arr[i] ;
- for (int i = 0; i != '\0'; i++) {
- sum += arr[i] ;
- }
- cout << sum ;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment