-1
Why this code is 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;
}
-1
Why this code is 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;
}
1
It’s just a typo namespace
is misspelled. This is because the code is written anyway. If you write a caution, whim makes it 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;
}
Behold working in the ideone. Behold working in the repl it.. Also I put on Github for future reference.
Browser other questions tagged c++
You are not signed in. Login or sign up in order to post.
Usually the compiler himself tells you this, just read the error message.
– Woss