Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- long long n;
- cin>>n;
- long long arr[n],sum=0;
- long long x;
- cin>>x;
- for(long long i=n-1;i>=0;i--){
- arr[i]=x%10;
- x=x/10;
- sum+=arr[i];
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement