What's wrong with this code? [closed]

0

Why is this code not being compiled?

#include <iostream>
using namesapace std;
int main(){
long long xm;
long long ym;
long long xp;
long long yp;
cin>>xm;
cin>>ym;
cin>>xp;
cin>>yp;
long long t;
t=(xp+yp)-(xm+ym);
cout<<t<<endl;
}
    
asked by anonymous 22.05.2017 / 00:00

1 answer

1

It's just a typo% namespace is spelled wrong. This is because the code is written anyway. If you write a caution, it's easier to avoid these mistakes and detect them more easily.

#include <iostream>
using namespace std;
int main() {
    long long xm;
    long long ym;
    long long xp;
    long long yp;
    cin >> xm;
    cin >> ym;
    cin >> xp;
    cin >> yp;
    long long t = (xp + yp) - (xm + ym);
    cout << t << endl;
}

See running on repl.it . Also I put it in GitHub for future reference .

    
22.05.2017 / 00:08