Skip to content
Snippets Groups Projects
Commit 2639dc14 authored by Sinaro LY's avatar Sinaro LY
Browse files

tp8 beginnning

parent b30daf8a
No related branches found
No related tags found
No related merge requests found
tp8/pile 0 → 100644
File added
// g++ pile.cpp -o pile -Wall -Wextra
#include <algorithm>
#include <vector>
#include <stack>
#include <iostream>
#include <iterator>
int main(int, char **)
{
std::stack<int> is;
std::stack<double, std::vector<double>> ds;
for (int i = 0; i < 100; ++i)
is.push(i);
while (!is.empty())
{
std::cout << is.top() << std::endl;
ds.push((double)is.top() * is.top());
is.pop();
}
return 0;
}
\ No newline at end of file
tp8/vect 0 → 100644
File added
//g++ vect.cpp -o vect -Wall -Wextra
#include <algorithm>
#include <vector>
#include <iostream>
#include <iterator>
int main(int, char **)
{
std::vector<int> v;
int input;
while (std::cin >> input)
v.push_back(input);
std::sort(v.begin(), v.end());
std::cout << "tri" << std::endl;
std::copy(v.begin(), v.end(),
std::ostream_iterator<int>(std::cout, "\n"));
return 0;
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment