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;
}
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;
}
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 .