Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main() {
- int n,x;
- while (cin>>n) {
- int totalx=0,totaln=n;
- for (int i=n-1;i>0;i--) {
- cin>>x;
- totalx=totalx+x;
- totaln=totaln+i;
- }
- cout<<totaln-totalx<<endl;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment