-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Assignment 0. #10
Merged
Merged
Assignment 0. #10
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
#include <bits/stdc++.h> | ||
|
||
using namespace std; | ||
|
||
namespace Solve { | ||
|
||
template<class T> inline vector<T>& operator<< (vector<T> &storage, const T& data) { | ||
storage.push_back(data); | ||
return storage; | ||
} | ||
|
||
template<class T> inline void operator!(const vector<T>& vect) { | ||
for(const T& data : vect) { | ||
cout << data << " "; | ||
} | ||
} | ||
|
||
template<class T> inline queue<T>& operator<< (queue<T> &storage, const T& data) { | ||
storage.push(data); | ||
return storage; | ||
} | ||
|
||
template<class T> inline stack<T>& operator<< (stack<T> &storage, const T& data) { | ||
storage.push(data); | ||
return storage; | ||
} | ||
|
||
template<class T> inline queue<T>& operator>> (queue<T> &storage, T& data) { | ||
data = storage.front(); | ||
storage.pop(); | ||
return storage; | ||
} | ||
|
||
template<class T> inline stack<T>& operator>> (stack<T> &storage, T& data) { | ||
data = storage.top(); | ||
storage.pop(); | ||
return storage; | ||
} | ||
|
||
void main(void) { | ||
ios::sync_with_stdio(false); | ||
register int i, j; | ||
long long a, b; | ||
cin >> a >> b; | ||
cout << a + b << endl; | ||
} | ||
} | ||
|
||
int main(void) { | ||
Solve::main(); | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
不建议在我们课堂上这么用
That header file is not part of the C++ standard, is therefore non-portable, and should be avoided.
CF,Topcoder这种切题的形式,可能加这么一个东西用起来很方便。
出于一下两点考虑我不建议这么用。
又因为我们的代码要互相review。希望同学们能够拉下来就能够编译和运行。 强烈建议不要这样写